So far, we have seen that the Amalekites were the nation that always opposed God's plan to bless the world. But even given that, it can still be difficult to see how the same God that loved his enemies so much that he died for them could command that the Amalekites could be wiped out in the way that he does in 1 Samuel 15.
The first place to start looking for an answer is in the passage itself...
In verse 5, Saul reaches the city of the Amalekites. But he doesn't attack immediately. Instead he sends a message to another tribe – the Kenites. According to Judges 4:11, the Kenites were the descendants of Moses' father-in-law, variously called Jethro and Hobab. Now here's an interesting contrast.
The first two groups of people that the Israelites meet after coming out of Egypt are the Amalekites in Exodus 17 and the Kenites (Jethro and his family) in Exodus 18. The Amalekites try to destroy Israel. Jethro and his family help Israel. They want in on God's blessing which is coming to the whole world, and they help Israel and worship the God of Israel.
So when Saul comes to fight against the Amalekites, the first thing he does is that he sends a message to the Kenites.
Then Saul said to the Kenites, "Go, depart; go down from among the Amalekites, lest I destroy you with them. For you showed kindness to all the people of Israel when they came up out of Egypt." So the Kenites departed from among the Amalekites.
1 Samuel 15:6
Now, that makes it look very much as if the Kenites are mingling with the Amalekites fairly freely. Suppose an Amalekite decided that they didn't want to fight against Israel. There doesn't seem to have been anything stopping them from deciding to be a Kenite – dressing themselves up as a Kenite and just slipping off. The Amalekites had a way out, if only they were willing to deny their identity as Amalekites.
You see, the Amalekites' national identity is set up against Israel and against God's plan to bless the world. But there is a way out – they just have to renounce that identity and join in with the people who worshipped and served God. They have to get rid of the thing that means they will be going against God. Maybe some of them did. But many of them didn't.
The second way out is the one given in Deuteronomy 20, which is where the laws for how Israel was meant to fight its battles are set out.
When you draw near to a city to fight against it, offer terms of peace to it. And if it responds to you peaceably and it opens to you, then all the people who are found in it shall do forced labor for you and shall serve you. But if it makes no peace with you, but makes war against you, then you shall besiege it. And when the LORD your God gives it into your hand, you shall put all its males to the sword...
Deuteronomy 20:10-13, ESV
I don't know if Saul followed this rule or not when he attacked the Amalekites, but he should have done. If the Amalekites had surrendered, they would have been spared. But once again, they would have had to renounce their identity as Amalekites and become vassals of Israel. The only way they would have been destroyed is if they refused to surrender to God's plan.
So the Amalekites as a group had the opportunity to surrender to God's plan to bless the world, and the Amalekites as individuals had the opportunity to renounce their group and join in with the people who had sought to be a part of God's plan. It's not exactly genocide, is it?
Paul Copan, in his recent paper Yahweh Wars and the Canaanites points out that the command is to kill whoever is there, but that doesn't necessarily mean that they kill women and children. As Goldingay writes: “When a city is in danger of falling, people do not simply wait there to be killed; they get out... Only people who do not get out, such as the city's defenders, get killed.” So the command in 1 Samuel 15:3 looks a lot less like genocide, and a lot more like “If anyone - man, woman, child, whoever - doesn't take the chance to give up their struggle permanently, then kill them. And make sure that you don't profit from doing it.”
This is backed up by the way that Hebrew writers seem to use language when talking about war. Here's an example.
Hadad was from the royal family of Edom, and here is how the LORD made him Solomon's enemy: Some time earlier, when David conquered the nation of Edom, Joab his army commander went there to bury those who had died in battle. Joab and his soldiers stayed in Edom six months, and during that time they killed every man and boy who lived there. Hadad was a boy at the time, but he escaped to Midian with some of his father's officials...
1 Kings 11:14-17, CEV
Killing every man and boy who lives in Edom doesn't mean “killing every man and boy who lived in Edom and making sure that none escape”. It seems that it means “making sure there aren't any men or boys living there any more.” In the same way, killing all the Amalekites seems to mean killing everyone who keep on identifying themselves as Amalekites and who keep setting themselves against God's plan.
This is about breaking and destroying the identity of Amalek as a nation, so that they as a nation cannot continue to oppose God's plan to bless the world. It isn't about hatred of individuals, or about killing those individuals, unless they want to keep on being Amalekites and to keep on fighting against God's plan.