They parallel the characteristics of our war with the flesh and sin.
(2 Samuel 1 (Part 1) Bible Study | Pastor Daniel Batarseh - https://www.youtube.com/watch?v=w8f4v5_G0t8)
War of Nine Kings, when Chedorlaomer's side came to En-mishpat (Kadesh) and defeated all the country of the Amalekites, and also the Amorites who were dwelling in Hazazon-tamar
Amraphel king of Shinar, Arioch king of Ellasar, Chedorlaomer king of Elam, and Tidal king of Goiim made war with Bera king of Sodom, Birsha king of Gomorrah, Shinab king of Admah, Shemeber king of Zeboiim, and the king of Bela (Zoar) in the Valley of Siddim (the Salt Sea). They had served Chedorlaomer for 12 years but rebelled in the 13th year. In the 14th year, Chedorlaomer's side defeated the Rephaim in Ashteroth-karnaim, the Zuzim in Ham, the Emim in Shaveh-kiriathaim, and the Horites in their hill country of Seir as far as El-paran on the border of the wilderness. Then they turned back for En-mishpat (Kadesh) and defeated all the country of the Amalekites and also the Amorites dwelling in Hazazon-tamar.
Amalek will be utterly blotted from memory
Then the Lord said to Moses, “Write this as a memorial in a book and recite it in the ears of Joshua, that I will utterly blot out the memory of Amalek from under heaven.” And Moses built an altar and called the name of it, The Lord Is My Banner, saying, “A hand upon the throne of the Lord! The Lord will have war with Amalek from generation to generation.” (Exodus 17:14-16)
Saul's order to wipe out the Amalekites
Saul fought all his enemies on every side when he took kingship over Israel. He struck down the Amalekites and delivered Israel out of the hands of those who plundered them. (1 Samuel 14:47)
Samuel told Saul that the LORD wanted every Amalekite and their livestock - men, women, children, oxen, sheep, camels, and donkey - destroyed for opposing Israel when they came out of Egypt. The people slew all but the best livestock for a future sacrifice. Saul captured King Agag alive. Samuel criticized Saul before hacking Agag into pieces himself. (1 Samuel 15)
After fleeing from Saul to Philistia with Achish the son of Maoch, king of Gath, David made Ziklag his base of operations for military exploits against the Geshurites, Girzites, and Amalekites. He reported his raids back to Achish as against the Negeb of Judah, Jerahmeelites, and Kenites and gained Achish's trust. (1 Samuel 27)
Saul's disobedience in wiping out the Amalekites
Samuel, raised by the medium of En-dor, tells Saul that the LORD has torn the kingdom out of his hand and given it to David because he did not obey the voice of the LORD and did not carry out his fierce wrath against Amalek. (1 Samuel 28)
Amalekites raid Ziklag
A band of Amalekites made a raid against the Negeb and against Ziklag. They had overcome Ziklag and burned it with fire and taken captive all the people, including Ahinoam of Jezreel and Abigail. David used Abiathar's ephod to learn he could pursue and overtake the band and rescue his people. The men that continue the full journey with David find an Egyptian servant left behind to die from the Amalekite band, and he agrees to lead them to them.
They were celebrating their spoil, and David struck them down from twilight until evening the next day with no survivors but 400 camel riders. The thievery was completely recovered, including his wives. He also captured the flocks and herds and the spoil from the Philistines, "David's spoil." (1 Samuel 30)
An Amalekite before David claimed to kill Saul
3 days after David returned to Ziklag, a man with clothes torn and dirt on his head came and fell on the ground and paid homage to David, saying he escaped from the Israel camp. David asked how the battle went, and he said the people fell and Saul and Jonathan died. He asked how this man knew, and by chance, he happened to be on Mount Gilboa when he saw Saul leaning on his spear with the chariots and horsemen pursuing closely. Saul called to him and asked who he was. Learning he was an Amalekite, he asked him to kill him. He complied, knowing Saul was close to death. He took Saul's crown and armlet to David.
David and his men mourned and fasted until evening for Saul, Jonathan, and the people of the LORD and the house of Israel. David learned he was the son of a sojourner, an Amalekite. He asked how he did not fear to destroy the LORD's anointed then executed him for his own mouth testified against him.
Jewish tradition holds this man was the son of Doeg the Edomite and that Doeg was Saul's armor-bearer, but it is strange Saul had to ask him who he was. Also, IDK if he would be considered a "sojourner" or "alien" at that point, even if he was a different ethnicity. (Matthew Henry's Commentary)
Amalek subdued
After receiving the Davidic covenant, the LORD gave victory to David wherever he went. King David dedicated the silver and gold from the nations he subdued, from Edom, Moab, the Ammonites, the Philistines, Amalek, and Hadadezer the son of Rehob, king of Zobah. (2 Samuel 8:11-12)