The relationship between Samuel and Saul is an interesting one, because it looks an awful lot like a power struggle between the secular and cultic leadership structures.
So we see, for example, Samuel directing political decisions by being God’s mouthpiece: he tells Saul to go after the Amalekites, to punish them for “opposing them [the Israelites] on the way, when they came up out of Egypt” (1 Sam. 15:2). In a sense, he is trying to direct the military aspect of governorship by proxy.
There is, however, a condition; the Israelites must kill all the Amalekites, even women and infants, even their livestock. Samuel is invoking the rules of holy war outlined in Deut. 20.
Interestingly, the incident Samuel is referencing (also outlined in Deut. 25:17-19) is narrated in Exodus 17:8-16. There, Joshua battled the Amalekites while Moses lead the cheers from the sidelines. Though the Israelites won, God promised to destroy them all later. Now he’s going to give it a go.
Saul musters 200,000 soldiers. That number either includes or is in addition to 10,000 soldiers from the tribe of Judah. This is the second time the soldiers of Judah are counted separately (the other time was in 1 Sam. 11:8), and I don’t know why that is. It could be that the source came from Judah, so they recorded their own numbers in the stories as a matter of interest.
When they reach the city of Amalek (probably not an actual city since it seems that the Amalekites were at least partially nomadic – I imagine that this is more likely a fortified base/trading centre), Saul reaches out to the Kenites who are living among the Amalekites, telling them to get out lest they be killed as well. According to the Deuteronomist histories, the Kenites are associated with Moses’ father-in-law (whatever his nom du jour happens to be – Judges 1:16; 4:11). Clearly, they were a group viewed favourably by the Israelites. The Kenites obey.
Saul defeats the Amalekites and (mostly) follows Samuel’s instructions. However, as we saw in the narrative of the battle of Ai, mostly doesn’t cut it. Saul keeps alive the Amalekite king Agag and a selection of the very best livestock, claiming that he wished to sacrifice these at a proper altar. He doesn’t seem to understand that this is disobeying Samuel’s commands, however, presumably figuring that he is going to kill them all anyway, wouldn’t it be better to do it in a ritualistic way rather than just slaughtering everything right away in the field?
When Samuel finds out, he is furious, and God “repents” of his choice of king. Samuel tries to confront Saul about it, but Saul has already left (after building himself a monument at Carmel) for Gilgal. Samuel heads after him.
When Samuel catches up to Saul, Saul is just beaming like a puppy super proud of himself for defending his owner from the danger of a pair of slippers. He boasts, “I have performed the commandment of the Lord” (1 Sam. 15:13). Samuel gets snarky, answering: “What then is this bleating of the sheep in my ears, and the lowing of the oxen which I hear?” (1 Sam. 15:14)
Since Saul did, by all indication, intend to follow out the command and to do so in a pro-God way, his error is not really heresy or disobeying God’s orders. Rather, the issue is that he did not perfectly follow Samuel’s orders – he tried to retain agency and to make his own decisions in the worship of YHWH. So what we are seeing is a prophet who is trying to direct secular matters, and a king who is trying to direct cultic matters.
Of course, since the authors knew that Saul did not establish a dynasty, it would have been easy for them to read in (or even write in) a defense of religious meddling in secular governance.
Saul’s defense is that, “I feared the people and obeyed their voice” (1 Sam. 15:24). If true, it makes him a weak king. If a lie, then he is failing to take ownership of his own actions. This is not a flattering portrait of the king. He begs for a second chance.
Samuel turns to leave and Saul grabs after him, accidentally tearing Samuel’s robe (apparently, some translations are less clear – seeming to indicate that it is Samuel who tears his robe, presumably for dramatic effect). To this, Samuel says: “The Lord has torn the kingdom of Israel from you this day, and has given it to a neighbour of yours, who is better than you” (1 Sam. 15:28).
The obvious interpretation is that this is a second version of Saul’s fall from grace. It’s possible, however, that this is an escalation. It could be that the punishment in 1 Sam. 13:13-14 is the loss of a dynasty only, whereas here God is withdrawing support from Saul’s own rule. It’s the difference between “we won’t be renewing your contract” and “please pack up your stuff.”
Samuel then calls for King Agag to be brought to him and, with a witty one-liner (or two-liner, I suppose, depending on your formatting), hacks the enemy king to pieces. This is yet another example of the secular vs religious authority battle, as it gives Samuel the final deciding military victory. It is the prophet who, in the end, is the one who literally defeats the baddies.
In the end, Samuel and Saul part ways, the former going back to Ramah while the latter goes to Gibeah. The narrative tells us that they will not see each other again until one of them (the language is ambiguous as to which) dies.
Even so, Samuel is said to grieve over Saul. I think that this is meant to show that it isn’t personal, or perhaps to highlight that the butting of heads is between God and Saul, not Samuel and Saul. It is the religious authority throwing their hands up and saying “Oh I‘m not the one who wants power, this is just about what God wants!” Or, more charitably, it points to a complex relationship in which Samuel is bound by the law regardless of his personal feelings, as in the story of Jephthah where he must kill his beloved daughter.