A question that frequently arises regards the sixth commandment: “Thou shalt not kill” (Exodus 20:13, KJV). Yet, a short time later, God commands Israel to kill the inhabitants of Canaan, including children. That God would both prohibit and command violence appears to be incongruous. Such an apparent contradiction provokes the conclusion that Old Testament instructions are untrustworthy and that the God of those times was unpredictable.
The truth, though, is that the God who gave these commands is the same One who died for the sins of mankind (cf. I Corinthians 10:1-4). The problem is not with God, but with man's understanding of His nature and intentions.
Notice that this same apparent contradiction is also found in the New Testament. On the one hand, Jesus teaches that murder begins in the heart—that harboring malice or enmity breaks the spirit of the law (Matthew 5:21-22). On the other hand, when Jesus is standing before Pontius Pilate, He says plainly that if His Kingdom were a worldly one, His servants would fight (John 18:36). They would go to war on His behalf!
It was Israel's responsibility to marshal an army to subjugate the people of the land. This is seen in Numbers 1, which takes place while Israel is still at Sinai about one year later. Numbers 1 records God telling Moses to take a census and determine the number of men who were able to go to war. Fourteen times in that one chapter God repeats the instruction to number the men who were able to “go to war”—even though He had just recently confirmed His promise to fight on their behalf. God would be driving out the inhabitants, but He was also preparing the Israelites to engage the enemy. Clearly, it was still God's intent that Israel do its part within the fight.
In God's view—the only view that matters—the land belonged to Israel. The Canaanites and others were essentially squatters. Because of their right of possession, Israel had the authority—and actually, the duty—to enforce God's laws within the realm that now belonged to them.
Israel was the “governing authority” of the land God gave to them. He intended that the leadership of Israel be a “terror to evil works” (including those of the inhabitants of the land), and He fully intended that Israel “bear the sword” (c.f. Romans 13:1-4). God requires that the civil authority “execute wrath” on those practicing evil—which certainly applied to the pagan peoples of the Promised Land.
In every place and circumstance where God gives Israel the duty to destroy the people of the land, He also mentions the idolatry of the peoples, along with demonism, sorcery, witchcraft, and child sacrifice. God was greatly concerned about the influence these things would have on His people, so He was particular in admonishing them to carry out the penalty of His law thoroughly.