The text seems to shift gears, speaking of utter destruction for some groups but offering peace to others. What's the crucial difference?
Deuteronomy 20 lays out two distinct scenarios for warfare, depending on the enemy.
Distant Cities (Deuteronomy 20:10-14)
For cities far from Israel, not part of the promised land's inhabitants, the protocol was to offer peace. If they surrendered, they would become tributaries, serving Israel. If they refused peace and resisted, then the males were to be killed, but women, children, and possessions were taken as spoil. This was a 'milder form' of the 'cherem' (devoted thing, i.e., utter destruction).
Canaanite Nations (Deuteronomy 20:15-18)
However, for the seven specific nations inhabiting the land God was giving Israel (Hittites, Amorites, Canaanites, Perizzites, Hivites, Jebusites), the command was different: 'You shall save alive nothing that breathes.' This was not about arbitrary cruelty, but about divine judgment and preservation. Their rampant idolatry and abominations had filled the cup of their iniquity, and their destruction was necessary to prevent Israel from falling into the same sin and to keep the land pure for God's people. This was a direct execution of God's judgment.
The Core Reason
The critical distinction hinges on the risk to Israel's religious purity. God's command to spare distant cities allowed for integration and potential blessing. The command to destroy the Canaanites was a safeguard against spiritual contamination.