Joshua 2:3
And the king of Jericho sent unto Rahab, saying, Bring forth the men that are come to thee, which are entered into thine house: for they be come to search out all the country. And the king of Jericho sent unto Rahab, saying, Bring forth the men that are come to thee, which are entered into thine house: for they be come to search out all the country.
The king of Jericho learned that men of Israel had come to search out the country and had entered Rahab's house. He sent to Rahab ordering her to bring forth the men who had come to her. The demand was aimed at her because the spies were known to be lodged within her house. Their work depended on secrecy, for if their enemies were alerted the opposition would be strengthened and the conquest made harder.
In that setting Rahab, a Canaanite, turned away from idolatry to the worship of the true God. She forsook her former gods and acknowledged the Lord as God. By that choice she joined herself to God's chosen people.