Did the witch of Endor summon Samuel or a demon

It’s said that the dead and the living have no communion. So it is demons who masquerade as departed ones. I have lost 2 people I loved dearly and was devastated by their deaths. They have appeared to me in dreams but we couldn’t communicate or anything. They did not appear to see me either. @Beenie what’s your take?

[COLOR=rgb(20, 20, 20)] On the other hand, God’s true servants never looked to such persons for information. When the Law was given to Israel shortly after their release from bondage in Egypt, they were strictly forbidden to consult “professional foretellers of events.” (Le 19:31[COLOR=rgb(20, 20, 20)]) Having “immoral intercourse” with them would result in being cut off (in death) from among God’s people. And as to the one practicing the art, the law went on to say: “As for a man or woman in whom there proves to be a mediumistic spirit or spirit of prediction, they should be put to death without fail.” (Le 20:6, 27[COLOR=rgb(20, 20, 20)]) Nearly 40 years later, when poised to enter the Promised Land and to drive out its inhabitants, Israel was reminded: “You must not learn to do according to the detestable things of those nations. There should not be found in you . . . anyone who consults a spirit medium or a professional foreteller of events or anyone who inquires of the dead.”—De 18:9-11[COLOR=rgb(20, 20, 20)].
More than 350 years later, Israel’s first king, Saul, removed all the foretellers of events from the land, but before his death he had fallen so far away from Jehovah that he personally sought out “a mistress of spirit mediumship in En-dor” to foretell his future. At first she was afraid to practice her art, but at Saul’s insistence that she “bring up Samuel,” she conjured up a vision. She described its form as ‘an old man wearing a sleeveless coat.’ Saul was convinced that it was the prophet Samuel. (1Sa 28:3, 7-19) But it could not actually have been Samuel, for he was dead, and the dead “are conscious of nothing at all.” (Ec 9:5) Samuel, when alive, would certainly have had nothing to do with a spirit medium, and Jehovah God and his holy angels would give such a one no cooperation. God himself told his people: “In case they should say to you people: ‘Apply to the spiritistic mediums or to those having a spirit of prediction who are chirping and making utterances in low tones,’ is it not to its God that any people should apply? Should there be application to dead persons in behalf of living persons? To the law and to the attestation!” Jehovah goes on to say: “Surely they will keep saying what is according to this statement that will have no light of dawn.”—Isa 8:19, 20.
Nearly 400 years after Saul’s reign, King Manasseh of Judah “did on a large scale what was bad in Jehovah’s eyes, to offend him,” including the consulting of professional foretellers of events, who flourished under his rule. (2Ki 21:6; 2Ch 33:6) All of these had to be cleaned out of the land by Manasseh’s grandson, righteous King Josiah.—2Ki 23:24.
The only mention in the Christian Greek Scriptures of demonic predicting of the future is the instance in which the apostle Paul, in the city of Philippi, freed “a certain servant girl with a spirit, a demon of divination.” She had furnished her masters with much gain “by practicing the art of divination"

My question is, these dead people we dream of or in Saul’s case was conjured by a witch was it that person ama its a demon? Si the Bible says it was the spirit of Samuel that appeared. So it was actually Samuel who appeared though he was dead. How can you differentiate? If it’s a demon or its actually that person’s spirit?

It’s a demon. Remember God had forbidden the Israelites from visiting witches and fortune tellers. Saul was also punished for visiting the witch.

If you look at acts 16:16-19, the young girl who had the ability to predict the future lost the gift after the demon was cast out of her by Paul.

The dead cannot communicate with the living, but often demons can imitate the dead loved ones voices like the case with the witch of en-dor

And what about the often famous images of the Virgin Mother of God that appears to selected few? Are they ghosts or demons? I mean, that Virgin mother died, didn’t she? So when she occasions those apparitions does she do it as a demon?