In the haftarah of parshas Zachor (I Shmuel 15:1-3) we read that Shmuel Hanavi, in relaying Hashem’s wishes, commanded Shaul Hamelech to destroy everything and everyone among Amalek, including men, women, children, and livestock. Shaul Hamelech killed everyone among Amalek except for the King, Agag, and the best of the livestock. In doing so he had not fulfilled that which was commanded of him; rather he did what was evil in the eyes of Hashem. Shmuel Hanavi then condemned Shaul for disobeying the word of Hashem, and informed him that Hashem has torn the kingship from him. Then Shmuel Hanavi had the king of Amalek brought before him, and said, “Just as your sword made women childless, so shall your mother be childless among women.” Shmuel Hanavi then executed Agag.
Rav Moshe Shmuel Shapiro, zt”l, quotes the following question in the name of the Brisker Rav: It seems from the statement that Shmuel Hanavi issued prior to executing Agag that he was killing him as a result of his being a murderer. Why did Shmuel Hanavi kill him only because he was a murderer? Was it not enough reason to kill him because he was an Amaleki – who we are commanded to kill regardless of whether they have murdered?
Rav Moshe Shmuel offers an answer to this question. There is a machlokes whether the mitzvah of zachor (remembering what Amalek did to us) is independent of any other mitzvah, or whether it is a prerequisite to the mitzvah of timcheh (annihilating Amalek).
The Rambam, in Sefer Hamitzvos (Mitzvos Assei 189), explains that the purpose of the mitzvah of zachor is in order to awaken our souls to wage war against Amalek. The Rambam writes that we must awaken our souls with these words (of remembrance of what Amalek did to us) in an effort to wage war against Amalek. The Rambam concludes his explanation of this mitzvah by quoting what happened before Shmuel Hanavi commanded Shaul to wage war against Amelek. Prior to commanding him, Shmuel Hanavi first recalled all the bad that Amalek had visited on the Jewish people upon leaving Mitzrayim. Only then did Shmuel Hanavi command Shaul to destroy them in fulfillment of the mitzvah of timcheh es zecher Amalek. It is evident from this that the Rambam is of the opinion that the mitzvah of zachor is a perquisite in the fulfilling of the mitzvah of timcheh.
Rav Moshe Shmuel suggests that according to the Rishonim who opine that the mitzvah of timcheh should be carried out only through the mitzvah of zachor, we can understand that with his statement, Shmuel Hanavi was not implying that he was killing Agag as a result of his being a murderer; rather he was fulfilling the mitzvah of zachor by reminding himself of the evil that Agag had done. This enabled him to awaken his anger toward Amalek and perform the mitzvah of timcheh.
I want to suggest another answer to the Brisker Rav’s question. The Rambam says in Hilchos Melachim (1:1-2) that there were three mitzvos that Bnei Yisrael were commanded to do upon entering Eretz Yisrael: 1) appoint a king; 2) destroy Amalek; 3) build a Beis HaMikdash. The Rambam writes that appointing a king must precede the annihilation of Amalek. Later in Hilchos Melachim (5:1), he writes that a king must first wage milchamos mitzvah (mandatory wars) and then may engage in milchamos reshus (optional wars). Among the milchamos mitzvah is the war against Amalek. The Oneg Yom Tov (hakdama ois vav) learns from this that in order to perform the mitzvah of mechiyas Amalek there must be a king over Bnei Yisrael.
In the pesukim preceding the execution of Agag, Shmuel Hanavi says several times to Shaul Hamelech that from this day forth Hashem has rejected you as king, and has torn the kingship from you and given it to your fellow who is better than you. At that time Bnei Yisrael was without a king, for Shaul was no longer the king and Dovid was not yet appointed. With this we can understand why Shmuel Hanavi killed Agag only as a consequence of his being a murderer, as the Brisker Rav pointed out, and not because he was an Amaleki. As we said, in order to do the mitzvah of timcheh there must be a king over Bnei Yisrael. Since there was no king at that moment, Shmuel Hanavi could not kill Agag because he was an Amaleki; rather he had to kill him for other reasons.