Deuteronomy 20 and Joshua 1-12
Ok, this part does horrify me. Chapter 20 of Deuteronomy lays out the principles of holy war.
At first it does not look so terrible, because the early passages either look reasonable or can be read metaphorically: Don't be afraid because God is with you. If you are in the middle of an important life transition (have just built a house but not yet dedicated it; have planted a vineyard but not yet harvested it; are engaged to be married but not yet married), or if you are just too afraid or disheartened, then you should not fight (Deut 20:5-9).
Furthermore, there is a passage that says that before attacking a town, offer terms of peace first (Deut 20:10). But there is an edge to this offer: if the inhabitants accept, then they are not to be killed, but to be forced into labor (Deut 20:11). If they don't accept, they are to be attacked, all the men killed, and the women taken "as booty" (Deut 20:12-14). Later, it turns out that this is not even an option for the towns within the promised land, but only the towns that "are very far away from you" (Deut 20:15).
"But as for the towns of these peoples that the Lord your God is giving you as an inheritance, you must not let anything that breathes remain alive. You shall annihilate them" (Deut 20:16-17).
Joshua 1-12 then tells the story of this holy war to the west of the Jordan River.
While much happens just as stipulated in Deuteronomy 20, there are exceptions to the "total annihilation" stipulation.
The first town to be conquered is Jericho. Joshua sends spies ahead to check things out. The two men go to the house of a prostitute named Rahab. She ends up hiding and protecting them (Josh 2:14), and so she and her family are protected when the rest of Jericho is annihilated (Josh 6:22-25).
The second exception was that after the conquests of Jericho and Ai, the inhabitants of Gibeon tricked Joshua into letting them live by pretending to be from far away and therefore exempt from the necessity of annihilation. Joshua made a treaty with them before discovering that in fact they were among the peoples he was supposed to annihilate, but now, having made the treaty, he had to keep his promise (Josh 9).
And, finally, in some of the battles, mention is made of survivors who escape to fortified towns (e.g., Josh 10:20); and by the time the Israelites stop fighting and divide the land, there is still land that was intended but has not yet been conquered (Josh 13:1-7).
So it seems that total annihilation was intended, to help protect the Iraelites from being tempted into worshipping the wrong gods, but this total annihilation was not quite accomplished. There are lots of hints that down the road, the Israelites do end up succumbing to such temptation, and so we'll have to read on to see if this in fact does end up happening.
But for now, the holy war has gained the Israelites (much of) their promised land.
So, how are we to read this story of war and annihilation?
One way is to read it literally: when you are obedient to God, and you fight a war and win, it proves that God is on your side. If you lose, it is because God is angry at you because of some flaw in your obedience to God (see Josh 7). So, might makes right because having superior might is a sign of God's favor. Unfortunately, I think that this is an all-too-common interpretation of war in general.
But are there metaphorical ways to read it that are less problematic?
A Spiritual Approach to Difficult Times
10 months ago