We must consider King Saul's state of mind. Early in his reign, under the tutelage of Samuel, Saul had been the great champion of Israel, pushing its enemies back and making good progress in forging a nation out of the twelve tribes. Yet, just about the time David came on the scene, he began to display severe emotional problems, exacerbated by “the Spirit of the LORD depart[ing] from Saul” and “a distressing spirit from the LORD troubl[ing] him” (I Samuel 16:14). Evidently, God allowed a demon to cause Saul distress—perhaps severe melancholy and fits of sullenness and anger—and only David's playing of his harp drove the demon away (verse 23).
Once David had slain Goliath and begun to receive acclaim from the people, Saul became murderously jealous of his young servant. Saul's distress soon warped into real anger (I Samuel 18:8) and suspicion (verse 9), and the next time David came to play his harp for Saul, the king cast a spear at him, shouting, “I will pin David to the wall!” (verses 10-11). The younger man escaped, only to have the scene repeated sometime later (I Samuel 19:9-10). Not long thereafter, David had to flee and hide in the wilderness.
We see, then, that Saul was highly susceptible to demonic influence and emotionally unstable. The distressing spirit that God allowed to torment him had played with his emotions for years, and it is likely that as he aged, as David eluded capture, and as the Philistines grew in strength, Saul only became more depressed and fearful. By the time he was camped on the slopes of Mount Gilboa, brooding over the advance of the Philistine army into camp on the opposite hillside, he was in a state of severe misery and near-terror, knowing that no happy ending awaited him the next day.
These three factors provide the background for the story in I Samuel 28: God is always against those who practice sorcery; Satan and his demons can appear as ministers of righteousness; and Saul himself, emotionally unbalanced, was predisposed to the sway of a demon. Knowing these things makes all the difference in how we understand the events at En Dor.