Summary: As the Philistines prepared for war against Israel, Achish the king of Gat asked David to be his personal bodyguard. Shaul was afraid when he saw the Philistine camp and attempted to ask God about his chances of victory, but received no reply. Despite banning witchcraft, he disguised himself and asked a woman who practiced necromancy to call on the spirit of Samuel. Samuel informed him that his reign as King had ended and he and his sons will die in battle the next day. Subsequently, the Jewish people would be delivered into the hands of the Philistines.
A deeper look: The Torah outlaws the practise of אוב (ov)and ידעוני (yidoni) which are types of necromancy (Deuteronomy 18:11, Leviticus 20:27). Yet in Saul’s desperation he employed a woman to bring up Samuel’s spirit.
The woman screamed when she saw Samuel’s spirit rise up (Samuel I 28:12). The Midrash notes that normally a spirit would ascend feet first but since Saul was still king, Samuel’s spirit rose head first out of honour for him (Tanchuma ibid.). The woman now realised that her client was none other than Shaul and feared that this was a ruse to expose her evil practises and punish her.
While Maimonides (d. 1204) dismisses necromancy and other forms of black magic as tricks and sleight of hand, others accept that it is real. It is difficult to understand how the Torah would ban mere trickery with the threat of capital punishment. Rashi (d. 1105) explains that the Egyptian magicians used the negative spiritual forces associated with the dead (Genesis 40:8). Nachmanides (d. 1270) explains (commentary to Deuteronomy 18:9) that this was why it was possible for them to imitate the miracle of Aharon’s staff turning into a snake (Exodus 7:11).
Rabbi Moshe Dovid Valle (d. 1777) notes that a spirit summoned from the dead would rise feet first because it is a way of disgrace and shame, fitting for an act which employs negative spiritual forces (Moshiah Chosim on Samuel I 28:12). According to Rabbi David ben Solomon ibn Zimra (d. 1573), Samuel was raised by God himself (Responsa Radbaz 3:642) which explains how he was able to rise head first.
Shaul admitted to Samuel that God had turned away from him. Samuel informed Shaul that having failed to defeat Amalek (Samuel I 15:28) his kingdom had finally been torn from him, paving the way for the new King David, Melech Yisrael.