When Israel was fulfilling the Lord's command to take possession of the Promised Land and drive out its inhabitants, the Gibeonites, who were among them, recognized what was happening and concocted a plan.
They disguised themselves as worn out, weary travelers and approached Joshua, telling him they were from a far away land. They "acted with cunning" (Joshua 9:4) to escape being destroyed along with the other Canaanite nations.
They knew they couldn't ask Israel to just leave them alone. They had to secure some kind of positive, ongoing relationship. So, using their disguise, the Gibeonites urged Joshua to become allies. "Make a covenant with us," they pleaded (9:11).