It happened, when Israel had made an end of killing all the inhabitants of Ai in the field, in the wilderness in which they pursued them, and they were all fallen by the edge of the sword, until they were consumed, that all Israel returned to Ai, and struck it with the edge of the sword.
One writer observed similarities between Joshua 7:1 to Joshua 8:29 and Deuteronomy 1:19 to Deuteronomy 3:11; Deuteronomy 9:7 to Deuteronomy 10:11; Judges 10:6 to Judges 11:33; and Joshua 20:1-9. He concluded that the biblical writer used similar motifs and terminology in these passages to impress on his readers by repetition three major lessons. First, Israel’s occupation of the Promised Land was not a sure thing but depended on her obedience to God. Second, defeat in the land need not be final and irreversible. Third, to regain the land the people had to deal with the guilty in Israel, and they had to return to obeying the Lord. [Note: Christopher Begg, "The Function of Josh. 7, 1-8, 29 in the Deuteronomistic History," Biblica 67:3 (1986):420-34.] 