When the Israelites entered the land, the city of Jericho fell before them under the strong hand of God. Achans sin caused their defeat at Ai. After they dealt with that sin, Jehovah instructed the people to attack Ai once again, promising them a victory. The strategy of attack was to be totally different to that used in Jericho. Israel accepted the counsel of Jehovah, their Commander. In the Christian life, God allows defeats to teach us lessons. When we take His counsel, all changes.
Thirty thousand selected soldiers lay in wait for the signal from Joshua (Joshua 8:4-7). The following morning Joshua advanced towards the city. When the people of Ai came out, the Israelites fled (v.17). Guided by the Lord, Joshua signaled his soldiers. They entered the abandoned city and set fire to it (vv.18-19). God demonstrated that He gives complete victory when He is in control.
Joshua highlighted this lesson when he constructed an altar, on which the people offered sacrifices. He wrote a copy of the law on its stones and read to all the people all that Moses commanded, including the blessings and the cursings of the law. Today we have the Bible to know Gods will and receive His counsel for our lives. How wise to take His counsel!