In this act, God instructed the Israelites to utterly destroy their enemies.
Saul lost his position as king over Israel due to failure to utterly destroy the Amalekites and spared Agag their king and the fat sheep and oxen. Samuel tells him in chapter 15:22 and 23 that obedience is better than sacrifice for rebellion is as withcraft. We have been made to believe withcraft only means astrology, or visiting the shrine. Hosea 6:6 says God desires mercy and not sacrifice, the knowledge of God rather than burnt offering. God requires us to fulfil all righteousness. James 2:10 says if you keep the law and transgress at one point you are guilty of all. Our hearts and response towards God's word matter alot.