The story of Rahab is a story of judgment.
Rahab knew judgment was coming. All the citizens of Jericho knew, too. They heard what the God of the Israelites had done to the Egyptians with the plagues and drowned the Egyptian Pharaoh and his army in the Red Sea. They heard how the Israelites, newly escaped from Egypt, overwhelmed the nomadic Amalekites with Joshua and Aaron holding up Moses’ arms during the battle (Exodus 17:8-16). They heard how the Israelites had defeated the Midianites with one thousand soldiers from each of Israel’s ten tribes (Numbers 31:1-8). They heard about the Israelites defeating the Amorite kings Sihon and Og (Deuteronomy 2-3).