The story of the Gibeonites and how they fooled Joshua is one of my favorites in the old testament. When Israel was taking the land of Canaan for themselves the people living there were terrified. The Israelites were huge in number and with God supporting them they were unstoppable. Several tribes or cities decided to band together and war against them as one. The Gibeonites, however, came up with a different plan.
They secretly sent emissaries to the Isrealite camp. They wore ragged clothing and shoes. Their wineskins were torn and patched, and they had moldy bread for food. When Joshua met with them, they told him they were from far away. Having heard of Israel and God's might they begged to make a covenant of peace with them. In return, they promised to become their servants. Joshua was suspicious at first, but after seeing their battered clothes and gear, he agreed.
He was quite upset, three days later, when they came to Gibeon and found those men living so close. The Isrealites complained to Joshua, but he kept his promise. He upheld the covenant with the Gibeonites, but also demanded they keep their promise as well. Joshua declared they would be wood cutters and water carriers for the Isrealites and their temple from then on. The Gibeonites happily agreed, glad to have saved their lives and city.
Joshua's mistake was not consulting with God before making the covenant, but I like to think God was pleased with the Gibeonites resourcefulness. When the combined tribes attacked Gibeon out of retaliation, Israel was forced to come to their rescue. They surprised the attackers at night and sent them fleeing. Afterwards, God sent hailstones raining down on them. The city of Gibeon was saved from both Israel and its enemies.
There are many instances in the bible where God rewards courage and resourcefulness, but mostly he rewards faith. When the Gibeonites were accused of deceit, they didn't deny it. They admitted they did it to save themselves.
Joshua 9:25-26 "And now, here we are, in your hands; do with us as it seems good and right to do to us." So he did to them, and delivered them out of the hand of the children of Israel, so that they did not kill them.
This verse is referencing Joshua when the Gibeonites answer him, but It felt like it could just have easily been attributed to God. When King Saul would later go on a rampage and try to wipe out the Gibeonites in his zeal, God would punish Israel for it with a three year drought. To end the drought, David had to deliver Saul's children to the remaining Gibeonites.
You could say that Gibeon was grafted into the kingdom of Israel. It's also telling that the Gibeonites saved themselves by coming to Joshua in the appearance of poverty and weakness promising to be servants. It's like how Jesus came to the world as a simple carpenter promising living water to anyone who would believe.
