King Saul had been commanded to kill out all the Amalekites. He did most of them but decided to spare the sheep. It was a moment of mistaken compassion, which he rationalized by saying he would use them as sacrifices in the mishkan. It turned out that the sheep were really Amalekites in disguise (whether by magic or not) and Shaul was punished because of his mistake.
Why do we dress up on Purim?
A common answer is that on Purim we recognize that hashem saved us in a hidden fashion and we dress up to show that we understand sometimes the ways of Hashem are hidden from us and we need to look further into things to see Hashem's presence.
I would like to suggest another answer, along a similar vein. That we dress up to show that not everything is as it appears to be. The amalekites "dressed up" like sheep and that fooled us originally, for which we paid a dear price. We need to recognize nto to take someone's appearance at face value. The external appearance is just that - external. We need to look behind the person's mask and see what is the makeup of the person. Who he really is and what he really is all about. We dress up on Purim to remember the first "costune" of amalek and internalize the lesson that we should not just look at the externals of a person.