*image originated here
Joshua 6 – 10
The difference between winning and losing a battle is whether or not God fights for you.
In the case of Jericho, God fought for Israel and the walls came tumbling down. Only Rahab the prostitute and her family remained because she rescued Israel’s spies. If they would have obeyed and not stolen from the objects they had devoted to God then they would have immediately taken Ai also.
They did not ask God if He would give Ai into their hands. Instead they acted as if they were the ones who determined victory and were driven back because of their faithless pride and disobedience. Only then did Joshua turn to God to find out what was wrong. He began whining as the Israelites had in the desert: “if only we had been content to stay on the other side of the Jordan!” he wept. God tells him to get up off his face and quit crying the reason they failed was becuase they disobeyed so God was not with them in the battle and He will not go with them to battle until the matter is made right.
The LORD shows them exactly who is responsible, he and his entire family are stoned and then burned as God commanded. Then His anger turned from them and He commanded that they conquer the city of Ai.
Once they have conquered Ai the remaining nations in the promised land are greatly afraid. Joshua completes what Moses commanded them to do on Mount Ebal, reading the law to the people, making sacrifices, and carving a copy of the law on stone tablets. While this is going on, five of their enemy nations band together to fight Israel, but Gibeon devises a way to make a peace treaty with them so that their lives will be spared. They do this by lying and saying that they have come from a nation far away. Joshua does not consult God and makes the treaty. Days later they find out about the lie and go to Gibeon. Joshua spares them from the people becuase of their treaty, instead making the people of Gibeon woodcutters and waterhaulers for Israel and the house of God at the place He will choose.
The other five nations hear of this and attack Gibeon. Gibeon calls out to Israel for help. God says He will go with them, so Israel drives out and defeats all five nations, burning their cities to the ground and killing all that breaths. The sun and moon are commanded by Joshua to stand still until this is finished.
“‘O sun, stand still over Gibeon, O moon, over the Valley of Aijalon.’ So the sun stood still, and the moon stopped, till the nation avenged itself on its enemies, as it is written in the Book of Hashar, The sun stopped in the middle of the sky and delayed going down about a full day. There has never been a day like it before or since, a day when the LORD listened to a man. Surely the LORD was fighting for Israel!”
When all this is completed Joshua returned with all Israel to their camp at Gilgal.
When you fight with God on your side you will not lose. He declares the victory and is the judge of defeat.