When the children of Israel crossed over Jordan into the Promised Land, God gave them a great victory at Jericho. The next city which they came against was a small town named Ai. Joshua sent spies unto the city. The spies were confident. Israel sent only a small army agianst the city. The children of Israel were defeated.
"Now Joshua sent men from Jericho to Ai." The Scripture doesn't mention Joshua seeking the Lord's advice. The Scripture doesn't say that God sent Israel against Ai. Was Joshua being presumptuous? Did he send the children of Israel against Ai without consulting the Lord? We know the children of Israel were defeated because of sin in the camp. However, keep in mind, this defeat was a learning point for Joshua. Joshua learned the battle is the Lord's. He learned to trust God. He learned the skill of Joshua and the might of the children of Israel were not sufficient to bring victory. Israel must depend on God.
Also, I want you to think about the response of Joshua. Joshua accused God. He asked God, "Why have you brought us here to deliver us into the hands of the Amorites?" When things went wrong, the first thing Joshua did was accuse God. He pointed his finger at God instead of looking at his own people. God had told Israel they would conquer the land. That should have been their expectation. Their defeat at Ai should have been an obvious sign that something was amiss in Israel. The problem was not with God, it was with the people.
How often do we point our finger at God when something doesn't go right in our life? When we face hardship and trouble, the first thing we want to do is ask God why He is allowing this to happen. What we should do is search our hearts. What we should do is look for our own sinful actions. What we need is to confess the sin which hinders us. The fault is always with us, not with God.
Johsua was fortunate that God was merciful and understanding. Joshua was new to leadership. He had much to learn about leading people. He was a God called man. He had watched Moses for years. However, things are different when you step into a leadership role. God was patient. God instructed Joshua. Ultimately, Joshua led the children of Israel into their promised possession. Praise be unto God for His unspeakable gift.