I want to know if the Egyptian magicians did real miracles or did they appear to do so by the means of a tonic to immobilize the snakes?
Also did the witch at Endor really summon Samuel or was it an illusion?
It might seem that the Egyptian magicians were able to do miraculous things, but we need to read the account carefully.
"So Moses and Aaron came to Pharaoh, and thus they did just as the LORD had commanded; and Aaron threw his staff down before Pharaoh and his servants, and it became a serpent. Then Pharaoh also called for the wise men and the sorcerers, and they also, the magicians of Egypt, did the same with their secret arts. For each one threw down his staff and they turned into serpents. But Aaron's staff swallowed up their staffs" (Exodus 7:10-12).
Notice that it states that they were able to turn their staffs into snakes "with their secret arts." Whatever they did, it was accomplished by human abilities. In fact, it is likely that they used a magician's trick.
"The magicians of Egypt in modern times have been long celebrated adepts in charming serpents, and particularly by pressing the nape of the neck, they throw them into a kind of catalepsy, which renders them stiff and immovable--thus seeming to change them into a rod. They conceal the serpent about their persons, and by acts of legerdemain produce it from their dress, stiff and straight as a rod" [Jamieson-Fasset-Brown Commentary].
"Walter Gibson, in his book Secrets of Magic, states that there is a certain type of snake that can be made motionless by applying pressure just below its head. Gibson also notes that the particular species of snake suitable for this stunt happens to be the naja haje (or haja), otherwise known as the Egyptian Cobra" [Kyle Butt, "Egyptian Magicians, Snakes, and Rods," Apologetics Press].
All it would take is a collapsable cane being switched by sleight of hand with a cataleptic snake to accomplish this apparent miracle. Yet, there was something different about Aaron's snake. It actually ate all the other snakes -- something a normal snake would not do in a short order of time.
Then there was the apparent turning of water to blood.
"So Moses and Aaron did even as the LORD had commanded. And he lifted up the staff and struck the water that was in the Nile, in the sight of Pharaoh and in the sight of his servants, and all the water that was in the Nile was turned to blood. The fish that were in the Nile died, and the Nile became foul, so that the Egyptians could not drink water from the Nile. And the blood was through all the land of Egypt. But the magicians of Egypt did the same with their secret arts; and Pharaoh's heart was hardened, and he did not listen to them, as the LORD had said" (Exodus 7:20-22).
Again, notice the phrase "did the same with their secrets arts." This indicates that human ability was behind the event. While the magicians were able to duplicate something like what God did, perhaps through the use of chemicals slipped into a container, what the magicians did was not even close to the scale of what God did. Nor could they undo what God did.
"So Aaron stretched out his hand over the waters of Egypt, and the frogs came up and covered the land of Egypt. The magicians did the same with their secret arts, making frogs come up on the land of Egypt" (Exodus 8:6-7).
For a third time, "their secret arts" is mentioned. While they managed to make frogs seem to appear, they again could not match God for the scale of what happened. Nor could they remove the frogs.
"They did so; and Aaron stretched out his hand with his staff, and struck the dust of the earth, and there were gnats on man and beast. All the dust of the earth became gnats through all the land of Egypt. The magicians tried with their secret arts to bring forth gnats, but they could not; so there were gnats on man and beast. Then the magicians said to Pharaoh, "This is the finger of God." But Pharaoh's heart was hardened, and he did not listen to them, as the LORD had said" (Exodus 8:18-19).
I've always been puzzled by this one. If someone has a trick to make frogs seem to appear, surely gnats would be easier since they are smaller. Yet "their secret arts" did not cover bringing gnats on people. Since the magicians could not match the feat in even a small way, they concluded that it must be God who was causing the plague. Again, since they could not match God in scale or remove what God did, I wonder why they did not come to this conclusion earlier.
"So they took soot from a kiln, and stood before Pharaoh; and Moses threw it toward the sky, and it became boils breaking out with sores on man and beast. The magicians could not stand before Moses because of the boils, for the boils were on the magicians as well as on all the Egyptians" (Exodus 9:10-11).
To add insult to injury, here God directly attacked the magicians and they were forced to flee.
In regards to the witch at Endor:
In the Hebrew language, a person who claims to consult with spirits is called by the word owb, which is usually translated as a spiritist or a person with a "familiar spirit." The literal meaning of the word is "one who mumbles in a bottle or a ventriloquist." Thus the word for referring to a spiritist also states that it was trickery (mumbling into a large bottle haves a hollow breathy sound to a person's words). Mediums and spiritists are among those condemned for practicing witchcraft (Deuteronomy 18:10-12).
When Saul went to a medium at Endor and asked to speak to the spirit of Samuel, we read, "When the woman saw Samuel, she cried out with a loud voice. And the woman spoke to Saul, saying, "Why have you deceived me? For you are Saul!" And the king said to her, "Do not be afraid. What did you see?" And the woman said to Saul, "I saw a spirit ascending out of the earth." So he said to her, "What is his form?" And she said, "An old man is coming up, and he is covered with a mantle." And Saul perceived that it was Samuel, and he stooped with his face to the ground and bowed down" (I Samuel 28:12-14). The woman screamed because something happened that she wasn't expecting. Instead of trickery, she actually saw a spirit rise and it scared her. Samuel's spirit then delivered the message that God had turned against Saul, that he would lose his kingship, and that the Philistines would shortly kill him. In other words, Samuel came, not because of the woman but because God chose to intervene to make a point with Saul.