The Israelites were very excited having just defeated Jericho. They continued on to the city of Ai. Joshua sent two spies to check on the city. They returned back and said, “We only need 3000 soldiers to defeat it.”
The 3000 Israelites went out to attack, but were driven back and chased off by the soldiers of Ai.
The Israelites were despondent and asked God why they had lost. God answered them, “Someone among you has sinned, and you are being punished for it.”
The leaders prayed about it and had each tribe stand before God. God separated out Judah, then he separated out the clan, the family, and finally Achan stood before the group guilty of stealing and hiding something from Jericho.
After he was punished the Israelites went out again and took all of the fighting men. One third of the men lured the army of Ai away from the town, while the rest went in and attacked the city.
The King of Ai returned to see the city burning.
Joshua and the Israelites fought many more battles with God fighting for them. At the end of his life Joshua gathered all of the Israelites together and challenged them to follow God and not follow the gods of the Canaanites.