God is no different, the circumstances are different.
Looking at the Bible as a whole, we have to see the purpose of the NT vs the OT and see that God never changed, rather the circumstances changed. The OT was about the covenant, and how Israel would save the world through this. If you stood in Israel's way of saving the world, you would have to to be moved. If you stand in the way of a train, you will die if you don't move. God's train was to bring Israel as a nation of priest to mediate between God and the Gentiles. So the Israelite's need some land to set up a kingdom, a kingdom that allowed anyone to join (if they followed the same covenant). If the Israelite's were able to live by the law, this could have been done and the world would have been saved through them. God moved the nations opposing them from taking this land that is rightfully theirs, and defended them against nations who attempted to take this land from them.
But in the NT, now the world is saved through Israel (as promised), but the only Israelite that could have defeated the power of sin in the flesh, was Jesus. The ultimate great high priest who is able to mediate between God and man. Once the world was saved (for those who ask of it), there was no more need for a physical nation, nor do we ever need to harm another physical nation. They can't stand in the way of God, because God's will has already been completed. "It is finished!". When those words were spoken, there will never be a need again to move a nation that is standing in the nation of Israel's way.
Now knowing that God has never changed, just the circumstances. How do we understand some of these circumstances were dealt with?
First I look at the Bible as a whole, and know that God show many examples of His mercy and goodness to man. He gives the Israelite’s multiple chances. He gives Sodom and Gomorrah multiple chances. He causes the rain to fall on the wicked and the righteous.
Though I don’t think God’s words were manipulated later to attempt to justify these battles. Knowingly changing God’s words of old to justify (in your mind) a battle of later sounds very proud, and I don’t see God tolerating that.
Canaan was cursed by an angry, embarrassed, hungover man. I don’t think there was any credence/power to those words. The Canaanites actually flourished and were prosperous for a time. It was there acts of wickedness that caused them to be punished, not this curse.
The best way I can attempt to explain the violence would be by looking at other passages.
Sodom and Gomorrah, He says he won’t destroy if even 10 are found righteous. He can’t find 10, but He even saves the 4 He could find. He attempted to save Lot, his wife, and 2 daughters. Gen 19:15
Gen 15:16 He waited 4 generations, it has not reached its limit yet.
Murder was never ok, this was killing a fellow human for means or rage or vengeance. They were instructed to kill from God, this was not murder. Had they decided to seek vengeance prior to God telling them to do so, they would be killed. Like when they attempt to conquer Jericho after the spies give bad reports and God says, never mind, you will not win, and they go on their own, they all die.
Justifiable war is deemed ok. Abraham waged war to rescue his relative in Gen 14. Self defense basically for your citizens who are being harmed or captured by another tribe is ok to wage war over.
1 Sam 15:2 God says he will punish the Amalekites for what they did to Israel when they ambushed them as they came up from Egypt. This is basically saying, vengeance (which is the Lords). The women and children weren’t those who ambushed them, wasn’t it their ancestors who did this?
When you lived in a kingdom/city, you basically agreed with everything they stood for and thought they would protect you. You had the freedom to leave that city, you weren’t slaves. You knew what your ancestors did. One way to punish a father is to wipe out his family and seed, the nation as a whole.
If the children are going to heaven anyway, would that be a mercy kill? You were brought up in a wicked land, so I am bringing you home to me early, because I have a greater purpose for the Israelites?
God also told Abraham to kill his only son, and when he listened in attempt to do it, God stopped him. Is it possible this was a test too and the infants would have been spared? Though it says Saul killed everything that was despised and weak to contrast the strong sheep and cattle he took. Maybe the infants were spared? It doesn’t say they were destroyed?
V 3 says destroy all that they have. Children were your possession. There is also Egyptians in the Exodus. The specifically had 1 born targeted. This was a blow to the adults, the living adults. It doesn’t seem to do as much to a patent if you kill them, then their children. But if you spare the parent and kill the children, this is harsh. But if you knew a war was coming, would you not send your children away so as not to get caught up? And if you didn’t send your children away, their blood would be on your hands?
This wasn’t tanks sent in. It takes a while for people to walk, especially thousands of them, it isn’t quiet or fast. Then later in Bible passages, it speaks of this same nation (that was supposedly 100% destroyed) rising up again? So it makes one think that perhaps, many did flee before the battle. But if one stayed in the battle, (I assume because moving is a pain, and if you pridefully think you are going to wipe your opponents clean and there is no need to flee) they your, and your children’s blood is on your head.
Which is also shown with Rehab. They are instructed to tie the scarlet so the soldiers pass over their household. If they are not in that household, theirs and their family’s blood is on their own heads.
V 8 “He took Agag king of Amalekites alive, and all his people he totally destroyed with the sword. The kings people were destroyed, sounds like soldiers to me, not civilians.
God values human life, but not so much animals. It was after Saul spared the best animals and killed the weak ones that the next verse says Saul did not carry out My instructions. God has always dealt with the heart rather than actions. The heart of Saul was proud in that He kept he king alive (as surrounding pagan nations did to humiliate) and the best animals (not trusting God will provide the best animals) and it needed to be taken in his own hands.
V15 again, “they spared the best of the sheep and cattle to sacrifice (because they thought sacrifice was an act of animals rather than a heart of obedience) but we totally destroyed the rest. Which again contrast animals. I am not 100% convinced that the infants and children were killed.
Num 31:35 He spared all the virgin women. But all the defiled wicked women and men die. We know the girls lived, I can only assume the boys lived too, but the men that fought were killed.
Daniel 5, the writing on the wall. V18 Your Majesty, the Most High God gave your father Nebuchadnezzar sovereignty and greatness and glory and splendor…V 20 But when his heart became arrogant and hardened with pride, he was deposed from his royal throne and stripped of his glory…V 21 until he acknowledged that the Most High God is sovereign over all kingdoms on earth and sets over them anyone he wishes.
Dan 5: 21 the Most High God is sovereign over all kingdoms on earth and sets over them anyone he wishes.
I also think it is very possible that God gave these cities warnings or writings on the wall. They were told this is God’s land, they refused and were proud and did not admit the King of Kings dominion, and perished for it by means of Israelite’s. Just like Belshazzar and the Babylonians were perished under the Medes and Persians.
God is also one who defends the weak. It isn't like Isabelle was a huge strong nation who bullied others. The Canaanites sure were though.
Gods wrath is also very pale in comparison to the other rulers of the ANE.
I like the question asked by one of the above links. Does knowing what we know about the OT make us more violent or less violent?
We wage wars to protect our ideals. We bombed many civilians indiscriminately in the past. We wage wars to grow our kingdom and spread our ideals. We wage wars for our gods.
Where the Israelites just wanted the land they took, no more. They protected their land. God told them to wage war for us. They left their country open to be joined, but weren't concerned on conquering the world and forcing their ideals on anyone.
These are just food for thought or possibilities, though we may never know how or why God did things. We can take heart in His goodness.