v.1: As Moses did before him, Joshua sends spies into Canaan to scout it out; after forty years, the situation may be different than it was when Joshua and Caleb (the only two survivors of the previous generation) first scouted it out. Joshua recommends Jericho specifically because (given the point where they will cross into Canaan) it acts as a gateway/barrier to the Promised Land, being a well-fortified city. In scouting out the land, they use the home of a local woman named Rahab as a cover, as it might not have be considered unusual or suspicious for them to lodge there (her house doubled as an inn and brothel).
v.2-7: The king of Jericho (Rahab’s city-state) gets wind that Israel’s spies are there, and he sends his troops to capture them. She hides the two men under flax plants on the roof (as another business, she may have woven cloth or at least supplied material for making it) and sends Jericho’s soldiers on a wild goose chase.
v.8-14: Rahab reveals that Israel’s reputation precedes them; their miraculous deliverance from Egypt (one of the mightiest empires of the day) and conquest of two kingdoms of the Amorites (cousins to the Ammonites, descendants of Abraham’s nephew Lot) east of the Jordan has already inspired fear in the peoples of Canaan. Because Rahab has helped Israel, she requests that Israel be gracious in return. When Jericho is conquered, Rahab’s family will be spared.
v.15-22: Here, we learn of special details. The walls of Jericho were so thick that Rahab’s house was built into a portion of it. Rahab helps the spies escape by letting them down to the ground with a rope; as a measure of accountability, they ask that she tie the rope in the window (it will be a sign to Jericho and Israel together, saying “this is the woman who was a friend to Israel”) from then until Jericho is taken.
v.23-24: The spies report back to Joshua, and he is encouraged. God is already preparing the way for Israel (lacking equal weapons and military training) to do battle with their Canaanite foes and take possession of the land.