Joshua 2:4

And the woman took the two men, and hid them, and said thus, There came men unto me, but I wist not whence they were:

Two men were sent in secret to explore the land, and this verse belongs to that mission. The secrecy mattered because alerting the opposing forces would have strengthened them. That strengthened resistance would have made it harder for Israel to enter and possess the land. The woman who hid the men was Rahab, a Canaanite by background. She turned from idolatry to worship the true God and joined His chosen people.