Question: What is a miracle? Why does Allah give miracles to the Prophets?
A miracle is an extraordinary act or a work which cannot be done or afford by people.
Allah invites the people, who backslide, led astray from the right path, and forgot their servant-hood, to the right path through the Prophets.
Allah gives miracles to His Prophets to prove their honesty, truthfulness, and to convince the deniers and infidels. This means that Allah approves their trustworthiness. Because, although it appears from the hands of the Prophets, they are still extraordinary wonders which cannot be done by people; only Allah can create the miracles. That is to say, miracles are the acts of Allah. (Treatise on Mu’jizat al-Ahmadiya, The Risale-i Nur Collection)
More on miracles:
Miracles, the Signs of Prophethood, are related to crafts of the ages prophets lived
As the art of magic was widespread at the time of Moses (AS), the important miracles that appeared with him were of appropriate nature; and the practice of medicine was prevalent at the time of Isa (Jesus) (AS), the miracles prevailing then were of the same kind. Similarly, four crafts were in great popularity at the time of Prophet Muhammad (ASW): first, eloquence and fluency in writing; second, poetry and oratory; third, soothsaying and divination; and fourth, knowledge about the events of the past and the facts of cosmology. [Bediuzzaman, 19th Letter, Second Remark]