God had instructed Israel to kill anyone among them who was a witch (Exodus 22:18 & Deuteronomy 18:10). It would have been Saul's duty to carry out that injunction in his day. And, at some point in his term as king, Saul had done exactly that (I Samuel 28:3). But, because he didn't vigilantly continue to do away with that evil option in his kingdom, and, because God refused to help him, Saul ended up consulting a witch himself to try to get direction for his future.
It is a strange story. Saul went to God for help. But, neither prophets nor priests were used of God to give him any information. So, he asked for a search. He wanted to find a witch. And, they found one living at Endor. So, Saul disguised himself and went to have her conduct a private séance for him. Now, necromancy (communication with the dead) was considered an abomination (Deuteronomy 18:10-11), but Saul wanted to speak with Samuel. And, Samuel was already dead. Hence Israel's king kneeled with this evil woman to seek an answer from the powers of darkness.
Now, admittedly the things that happened there that night were strange. Closely examining what happened there will not necessarily yield anything profitable for us. Was it truly Samuel that came to talk to Saul, or was it a demon assuming Samuel's identity? Does it ultimately even matter? The devil was the wicked influence at work there that night and Saul stood condemned already. God had moved on from him.