Thank you for the interpretation question, “Since necromancy was forbidden in ancient Israel, how can The Witch of Endor, found in 1 Samuel 28, be explained?”
Your observation that witchcraft which includes consulting of a dead person is forbidden in the Torah (Exodus 22:18 and Leviticus 19:26).
Leviticus 19 says this in the NIV, “‘Do not turn to mediums or seek out spiritists, for you will be defiled by them. I am the LORD your God.”
For one’s consideration, this is how one may explain the Witch of Endor.
A. This woman acknowledges that witchcraft or sorcery was punishable by death and had been banned in Israel (I Sam. 28:3).
B. This woman was known for her past or present “secret” practice of witchcraft (vs. 9). It appears she was well known in the area since Saul’s military men knew of her. “There is one in Endor,” they said” (vs. 7b). The text is unclear whether she was practicing her witchcraft in secret or for her past fame.
C. King Saul sought either the favor of the LORD in knowing how to engage the enemy or the outcome of the impending battle from the priests.(vs. 5). God didn’t give Saul a reply (vs. 6).
D. King Saul in his desperation sought to know the outcome of the impending battle (vs. 13). In one sense, Saul already knew the outcome as given by Samuel when he declared that the kingdom will be torn from him and given to another person who is better or more worthy than he (15:26–29). There would be another king of Israel who would replace him. The implication is that he must die before another king can be inaugurated. Thus in the back of Saul’s mind, he knew this but he was seeking to ascertain God’s plan to avert the impending defeat by the Philistines.
E. King Saul justified in his own mind that he was not consulting a sorcerer but the prophet of God, Samuel even though he was using a witch to call up Samuel. Scholars do debate whether this being that spoke to Saul was Samuel himself, the spirit of Samuel, a demon who took on the appearance of Saul, or some trickery in calling up “Samuel.” The Witch at Endor rightly declared that if she did this for him that she would be taking her own life if Saul finds out. With the promise given by this man, she proceeds to call up “Samuel.”
God gave to the High Priest the ephod that contain the Urim and Thummin to discern the will of God. Since the LORD God didn’t answer King Saul, he sought to gain the answer through the deceased Samuel. When people are in a desperate situation, one may turn to any means for help or relief of one’s pain. Saul had no one else to turn to so he reverted to seeking the advise through a sorcerer for the answer that he wanted. His men found a woman who had the ability to speak to or to conjure up a dead person or a being who resembles the appearance person of the dead person.
SUMMARY: A law that prohibits a particular conduct does not mean that everyone will obey that law. To those who seek to violate the law, secrecy is the key to avoid being caught and punished. The Witch at Endor was cautious in practicing her sorcery.
For more perspectives: