If there is no difference between magic and miracle, how can it be understood that miracle is different from magic?
The word miracle (mu’jiza) stems from the word ajz, which is the opposite of power, in Arabic. It is a term meaning something that incapacitates, something that cannot be resisted, unique and wonder.
Miracle is an extraordinary event that is contrary to the laws of nature and that God Almighty creates through His prophets in order to support His prophets who claim to be prophets against deniers and to affirm their prophethood and that is impossible to be done by others. (at-Taftazani, Sharhul-Aqaid an-Nasafiyya; Cairo 1939, p. 459-460; For the other definition, see al-Jurjani, Sharhu'l-Mawaqif, III,177; al-Jaziri, Tawdihu'l-Aqaid, 140).
As it can be understood from the definition above, miracle is an act of Allah. It is Allah who creates it in the hands of His prophet and who shows it. To show an extraordinary event through a prophet that declares his prophethood and challenges deniers and that incapacitates everybody denotes the proof and confirmation of the prophethood of that prophet. That a prophet shows such a miracle means, “My slave is right when he declares his prophethood; he is honest and what he declares is true.” The conditions “to claim to be a prophet” and “to challenge” in the definition discriminates miracle from the extraordinary events that are called “karamah” and that are done by saints, the righteous slaves of Allah. The saints of Allah do not “claim to be prophets” and they do not “challenge”. The karamahs that they show are regarded as kinds of miracles of the prophets that they follow and whose shariahs they are subject to. (Jalal ad-Dawani, Sharhu'l-Aqaidi'l-Adudiyya, II, 277).
There are some conditions for a miracle to be sound and acceptable.
1- A miracle must be an act of Allah because Allah creates what He wishes. He confirms something that is created by Himself only. For instance, when Moses turns the staff (rod) in his hand to a snake and when Jesus revives a dead person, they are the acts wished and created by Allah. Their attribution to prophets are metaphorical.
2- A miracle must be something extraordinary, contrary to the laws of nature. Only then can it be affirmed by Allah. The events that take place in accordance with the laws of nature and the normal system of the universe like the rising of the sun is nothing extraordinary.
3- They must be impossible to object to because the function of a miracle is to incapacitate and to silence those who oppose it.
4- A miracle must be carried out by the person who claims to be a prophet as a proof of Allah’s confirmation.
5- The miracle that is shown must be in accordance with the thing that the prophet declares that he will do.
6- The miracle shown in accordance with the claim of the prophethood must not refute itself.
7- A miracle must not take place before the claim or a long time after the claim; and it should take place just after the claim of the prophet. (al-Jurjani, Sharhu'l-Mawaqif, III, 177-179).
Magic is different from miracle. Qurtubi says, “As a matter of fact, magic means covering something by tricks. The magician does something using some tricks and shows it to be different to some people. Magic is not real just like mirage.”
That magic is different from miracle is explained in the following verses of the chapter al-Araf clearly:
115- The magicians said: "O Moses! wilt thou throw (first), or shall we have the (first) throw?"
The magicians, who were promised by Pharaoh that they were going to be rewarded said to Moses, “O Moses! You throw your rod first, or we shall throw first?”
116. Said Moses: "Throw ye (first)." So when they threw, they bewitched the eyes of the people and struck terror into them: and they showed a great (feat of) magic.
Moses wanted the magicians to show their skills first so that people will see their skills, think and their excitement will call down. Then they will be able to witness the truth that Moses will show to them.
Yes, all of the magicians showed their skills; they bewitched the eyes of people and struck terror into them. However, when they saw the truth, they declared that they became believers.
Abdullah b. Abbas says, "Magicians threw thick ropes and log trees. Then, by casting a spell, they showed them as if they were moving. People became afraid of them.
117. We put it into Moses's mind by inspiration: "throw (now) thy rod": and behold! It swallows up straightway all the falsehoods which they fake!
Abdullah b. Abbas says, “The rod of Moses started to swallow all of the ropes, pieces of wood, etc. Therefore, understanding that it was a divine miracle not a magic, the magicians prostrated and said, ’We believe in the Lord of the worlds, the Lord of Moses and Aaron’”
118-119. Thus, truth was confirmed and all that they did was made of no effect. So they were vanquished there and then, and were made to look small.
Thus, it became clear that Moses was a true prophet and what the magicians made up was eliminated. There, they were defeated and made to look despised.
120-121-122. But the sorcerers fell down prostrate in adoration. Saying: "we believe in the Lord of the worlds. The Lord of Moses and Aaron."
The magicians understood before everyone else that what Moses showed was not magic because they knew very well what they themselves did and how they deceived people; what Moses showed was not like the things that they had been doing. Therefore, they accepted the truth, prostrated and believed in Allah.
Abu Jafar Muhammad b. Jarir at-Tabari, Taberi Tefsiri, Hisar Yayınevi: 4/97-98.