Joshua 8:15

And Joshua and all Israel made as if they were beaten before them, and fled by the way of the wilderness.

The feigned defeat and flight toward the wilderness belonged to Israel's renewed advance against Ai after Achan's sentence was carried out. That execution had turned away the wrath of God from Israel. God then commanded Joshua to marshal all the men of war and advance against Ai again. Obedience to God was Israel's only hope.

God's power was with Israel in this advance, so they soon possessed the city. The armies of heaven fought for Israel, and their enemies were put to flight.