Thank you for contacting BibleAsk.
When Joshua asked the Lord why He has left them. God informed Joshua of the sin of Achan and explained that Israel would not be victorious until the sinner was removed from the camp. The nation of Israel was in a covenant relationship with God. When this covenant was broken by Achan, Israel lost its promised protection from God (Joshua 7:4-5). Achan stole that which was “devoted to destruction” and so brought destruction on others (Joshua 7:12; 22:20). So, Joshua immediately removed this sin from the camp and God’s favor upon them was restored.
But God used this set back to give Israel added victory which in turn caused the nations around them to fear them even more than before. And the Lord gave Joshua a plan for defeating Ai. The Lord instructed Joshua to set an ambush behind the city. Then, he was to set a group of soldiers in front of the city and retreat as in the previous battle (Joshua 8).
When all the men of Ai saw the retreating Israelites, they thought that the Israelites were defeated as in the previous battle, and they all confidently followed the Israelites leaving the city unguarded. Those hiding in ambush then attacked the city, and sent a sign for the retreating Israelites to turn and fight. And Ai was utterly defeated and Israel had a great victory.
God used Israel’s first defeat to set the stage for a major victory, by making the defeat look intentional. God showed the Canaanites that Israel under His guidance possessed superior military strategy and power. And the fear of the Lord fell over all the surrounding nations.
In His service,