ANSWER: The city of Endor, where the witch was located, is in the Northern part of the land God gave to the Israelite tribe of Isaachar. It was a city, however, assigned to the tribe of Manasseh (Joshua 17:11).
The first question to ask is how did this first human king of Israel, selected by God, got to a point where he would use the services of a witch? Although his rule started out well, he soon began to have troubles. He disobeyed God's law when he offered burnt and peace offerings before a battle, a responsibility given only to priests (1Samuel 13:7 - 14). His punishment for this action was that his descendants would not rule Israel.
Saul later disobeyed the Eternal and lied to Samuel when, instead of killing all the Amalekites and destroying all their possessions, he kept the evil Amalekite king alive and tried to take the best of the animals for himself (1Samuel 15:1 - 26). Additionally, the spirit of the Lord which was upon Saul was soon taken from him and he began to be troubled by an evil spirit (1Samuel 16:14). King David's rise in popularity (1Samuel 18:7) leads Saul to fits of rage and revenge against him. Sometime later, his friend and mentor Samuel dies (1Samuel 28:3).
King Saul unsuccessfully tried to consult God regarding his upcoming battle with the Philistines through the accepted means of the Urim and Thummim, as well as the prophets (1Samuel 28:6). He was now clearly a troubled, rejected man who desperately wanted counsel regarding what he should do next. It is at this point in his life he seeks to contact the prophet through a woman who had a 'familiar spirit,' a witch of the city of Endor.
Saul disguised himself in order to meet with the witch. When he finally visited her in secret, he asked her to contact the dead spirit of Samuel.
(Saul asked the witch) said to her. 'What do you see?' 'I see a spirit coming up from the earth,' she answered. 14 'What does it look like?' he asked. 'It's an old man . . . He is wearing a cloak.' Then Saul knew that it was Samuel . . . (1Samuel 28:13 - 14)
The vision that appeared to Saul through the witch of Endor was NOT really Samuel. The Hebrew word for 'medium,' 'spiritists' and so on are belowb, which means, "possessing a familiar spirit." God spoke about what he thought about such people and warned others not to consult them.
Do not go for advice to people who consult the spirits of the dead (Leviticus 19:31, see also 20:6)
27 Any man or woman who consults the spirits of the dead shall be stoned to death; (Leviticus 20:27)
He had Moses tell the children of Israel that it was the practices of the original inhabitants of the land of Canaan, such as human sacrifice, divination, sorcery, witchcraft and consulting the dead, that had caused Him to decide that the Israelites would take their land from them (Deuteronomy 18:9 - 14).
Although the Bible does not say the witch of Endor used the power of Satan to do her "consulting of the dead," we are told that she was possessed with a "familiar spirit", i.e., a demon, and by the scriptures quoted and many others, we know such things DO NOT come from God.
Whatever or whoever it was that Saul saw in the vision conjured by the witch, it certainly was not Samuel for he was dead (1Samuel 28:3). We also know that the dead "know nothing" and have no part "in any thing under the sun" (see Ecclesiastes 9:5 - 6). The vision told him that Israel was going to lose its battle, Saul and his sons would be killed, and the kingdom would be handed over to David. This is only PARTLY true. The enemy did not kill the king. Rather, he killed himself after receiving several wounds from Philistine archers (see 1Samuel 31:1-6; 2Samuel 1-5). God controls all things. Perhaps He controlled the vision that Saul saw, but I think it more likely that the demon in the witch of Endor took delight in taunting the king.