The twelfth chapter of Joshua summarizes the kings defeated by not just Joshua but also his predecessor, Moses. The first six verses mention two kings Moses and the children of Israel encountered while wandering in the wilderness: Sihon (see Numbers 21:21–31; Deuteronomy 2:26–37) and Og (see Numbers 21:33–35; Deuteronomy 3:1–17). These two kings occupied territory east of the Jordan (compare Joshua 12:1–2). The text thus expands the scope of Israel’s conquests into the land east of the Jordan River.
The rest of the chapter (verses 7–24) summarizes the thirty-one kings subdued by Joshua. The list given here greatly expands the number of conquered cities or kings that was described in the narrative of the previous eleven chapters. This suggests that the author or compiler of the book of Joshua had at his disposal more sources for the conquest than what made it into the final version of the story and that the preceding narrative is highly selective. The conquests depicted narratively in the book of Joshua were thus selected for specific ideological or theological purposes, and much of the history of the underlying events of the conquest remains unknown.
This sort of quasi-propagandistic restatement of conquered kings or cities is hardly unique to the book of Joshua. Egyptian and Mesopotamian monarchs likewise recorded their military victories in the form of long lists of conquered lands and cities on royal monuments as a way to either legitimate their reign or glorify the gods (or both). The rhetorical thrust of the list presented here is clearly intended to do something similar: to lay claim to Israel’s territory and legitimate its emergence as a nation and to glorify the Lord as Israel’s divine warrior.