The Lord wanted Israel to destroy all the inhabitants of the Land of Canaan, and the Gibeonites knew it. Therefore, they went to Joshua and the leaders of Israel, seeking to persuade them to make peace, arguing that the Gibeonites were not from the Land of Canaan, but from a far away place,
“Therefore our elders and all the inhabitants of our country spoke to us, saying, ‘Take provisions with you for the journey, and go to meet them, and say to them, “We are your servants; now therefore, make a covenant with us.”’ This bread of ours we took hot for our provision from our houses on the day we departed to come to you. But now look, it is dry and moldy. And these wineskins which we filled were new, and see, they are torn; and these our garments and our sandals have become old because of the very long journey” (Joshua 9:11–13).
The deception worked. Joshua and the leaders assumed that these people were telling the truth, leading Joshua and the leaders to fail to do something that could have revealed the deception,
Then the men of Israel took some of their provisions; but they did not ask counsel of the Lord. So Joshua made peace with them, and made a covenant with them to let them live; and the rulers of the congregation swore to them (Joshus 9:14–15).
They failed to ask the Lord about the matter, and He would have revealed the deception, and they never would have made peace with haters of righteousness and of the Lord.