“and they captured it.” “Captured” is the same Hebrew word used when Achan was “captured” by lot and discovered as the one whose sin caused the defeat of Israel and the death of 36 men (Josh. 7:16-18). Israel could not capture Ai because of the sin of Achan. Then Achan was “captured” by lot and dealt with, and then Ai could be captured. Although we all sin, to see the fullness of God’s blessing, especially those who are mature believers need to be serious about dealing with their sin.
“set the city on fire.” It is not clear as to why God commanded to burn Ai. God had said Israel would get to live in cities they had not built (Deut. 6:10), and Israel only burned Jericho, Ai, and Hazor. It is possible that because word might have spread among the local nations that Israel had been defeated at Ai that God knew that indigenous people could see the smoke from Ai burning many miles away and would again fear Israel. It certainly discouraged the men of Ai, as we see in the following verses.