One immediate recognition in my mind is that there is a very long answer to this question, with some subtle, nuanced work offered by various learned and insightful OT theologians (e.g. Walter Moberley in his Old Testament Theology) which, in turn, builds on the complexity of authorship (competing voices, diverse aims and objectives in the writing community behind the OT documents as we now have them). This, at least potentially, softens our first reading of passages in which God says, swords swing, heads fall, and even children are slaughtered in the pursuit of purity.
My next recognition is that where questions about the vengefulness and vindictiveness of God are being asked outside the gentle, timeless atmosphere of academia, a shorter rather than a longer answer to the kind of questions voiced below might be helpful.
A third recognition is that I do not think it possible to reconcile the two versions of God without the possibility that an adjustment may be required of our understanding of the relationship between the words of Scripture and Scripture as the Word of God.
This is because the simplest route to reconciliation is to emphasise the humanity of certain passages over their "divinity." That is, to emphasise that certain difficult passages
(1) express a theological view of human authors rather than a direct divine command to be taken literally;
(2) may idealise a situation rather than tell us what actually happened. I give an example below.
If this is so, that may be
(i) challenging for many Christians to accept;
(ii) with consequences for how we understand a number of other passages we do not have in mind as we raise a particular question about the violence of God.
Moberly, in his Old Testament Theology (Grand Rapids, MI: Baker, 2013), takes up the question of Israel being "A Chosen People" (Chapter 2), which is the summary cause for "the ban" or holy war of destruction (herem) of that which stands in the way of the chosen people achieving possession of the Promised Land. I here give a brief exposition of a part of what is a much longer and more detailed discussion of these matters, which also takes into account material in Joshua.
Taking up Deuteronomy's "prime passage about election", Moberly discusses Deuteronomy 7:6-8 with reference to Deuteronomy 7:1-8 (pp. 54ff). In 7:2 God commands the utter destruction of the nations which stand in the way of Israel's occupation of the land promised to it.
He notes, incidentally, p. 56, that one of the most frequent approaches of scholars to Deuteronomy 7:6-8 on election is to ignore the role of election in connection with holy war. (Check out commentaries on Deuteronomy to see that this is so.)
Moberly recommends close reading of the letter of the text because that steers us away from taking the text literally.
In doing this we notice several things. One is that the seven nations mentioned do not actually occupy only the promised land; they are more widespread. This suggests that they stand symbolically for the enemies of Israel.
Another observation is that immediately after the words in verse 2 about utter destruction of these enemies, Israel is commanded to "make no covenant" with them and not to "intermarry with them" (v. 3). These instructions are at odds with utter destruction: covenants are not made with dead people and intermarriage presumes not all have been killed.
This close reading of the letter of the text suggests that we do not take the text literally. Instead we should consider its rhetorical nature and its symbolic character.
That is, bearing in mind that Deuteronomy is a text which Israel is reading after the Babylonian exile, in a period when it has no military power to drive out any actual, physical enemies, we ask what it is actually persuading Israel to think and to do, and we ask what the reference to enemies being destroyed symbolises.
Thus Moberly, p. 61, proposes:
"Since, to put it bluntly, corpses present no temptation to intermarriage, the text surely envisages the continuance of living non-Israelites in close proximity to Israel.
In the light of this, I propose a reading of Deuteronomy 7:1-5 in which the text is construed as a definitional exposition of herem as en enduring practice for Israel."
In practice this means, negatively, avoiding intermarriage because this leads to "religious compromise," and, positively, destroying "those objects that symbolize and enable allegiances to deities other than YHWH (7:5)" but not destruction of people (p. 61-62).
"In other words, herem is being presented as a metaphor for unqualified allegiance to YHWH" (p. 62).
He then makes the point that this is not "mere metaphor" because some specific actions are envisaged: avoiding intermarriage and destroying religious symbols which would compromise allegiance to YHWH. But such practices "do not entail the taking of life on the battlefield" (p. 62).
In other words, consideration of the human authorship of Deuteronomy, including the fact that it is not actually a text written at the time of the conquest of Canaan, and recognition of the human intentions of the text, to utilise the past (Israel entering the promised land in the time of Moses) in order to lay down a command for the present (Israel in Babylonian exile and Israel returning from exile to Judah), leads to new understanding.
Our first reading of the text, which implies a savage God bent in destroying people, gives way to a second reading of the text, in which we read something which is consistent with the continuing messages of the whole of Scripture: that God is love and God desires our unqualified love for him.