Based on the information in 1 Samuel 15:4-9, God instructs Saul to attack the Amalekites and totally destroy them; men, women, children, infants, cattle and sheep, camels and donkeys. So Saul puts together an army of two hundred thousand foot soldiers and ten thousand men from Judah. The record says that Saul “took Agag king of the Amalekites alive, and all his people he totally destroyed with the sword.”
But does that mean the entire nation of the Amalekites was destroyed, including all the women and children? The Hebrew word which is usually translated as "the nation" or "the people" can also refer to military troops as in 1 Samuel 15:4. The Hebrew word used in 1 Samuel 15:7 has the same meaning as in 1 Samuel 15:4 (and 15:20). It was only the Amalekite army who were destroyed (apart from King Agag).
Source: Did Saul lie to Samuel in 1 Samuel 15:7?
The biblical account records events as described by Saul, which, given his character, may not have been the truth, the whole truth and nothing but the truth. Consider his excuse for not killing all the livestock, for example. Rather than there being a contradiction in scripture, the more obvious reason for the conundrum is that although Saul attacked the Amalekite army he did not not complete the task according to God’s instructions. Saul’s rebellion against God was so serious that he was rejected by God as king:
“For rebellion is as the sin of divination, and presumption is as iniquity and idolatry. Because you have rejected the word of the Lord, he has also rejected you from being king.” (1 Samuel 15:23).
How come David fought an Amalekite army that Saul had allegedly eradicated a few years earlier? (1 Samuel 30:17-18) Perhaps the Amalakites conscripted the help of their friendly neighbours. Israel had many enemies and it is possible that the Amalekites who had not been killed by Saul sought the help of neighbouring tribes to harass David by stealing and by abduction. When David came against the army of the Amalekites it may have been composed of warriors from various tribes – mercenaries or soldiers of fortune who had joined up with the Amalakites against Israel.
Because of Saul’s failure to wipe out the Amalekites, they continued to harass and plunder the Israelites over hundreds of years. During the reign of King Hezekiah, a group of Simeonites “killed the remaining Amalekites” who had been living in the hill country of Seir” (1 Chronicles 4:42–43). The last mention of the Amalekites is found in the book of Esther where Haman the Agagite, a descendant of the Amalekite king Agag, connives to have all the Jews in Persia annihilated by order of King Xerxes. God saved the Jews in Persia, however, and Haman, his sons, and the rest of Israel’s enemies were destroyed instead (Esther 9:5–10).