Allah sent the prophets to teach people their religion, guide them towards righteous deeds and forbid them to do evil and spread corruption. But most people did not believe them. Instead, they asked for some evidence to prove their truthfulness and prophethood.
Thus, Allah bestowed upon His prophets certain powers which were difficult or impossible for others to perform. This was to make people realize that such things were the work of Allah and could only happen because of His Omnipotence.
The miracles of the prophets include:
The Miracle of the Prophet Abraham [a]: When he called his people to give up their idols and to worship Allah, they disbelieved him and their ruthless king decided to burn him. After collecting firewood and putting Abraham [a] in the middle, they set it on fire. The fire remained burning for a long period, but Abraham [a] was not burnt as he was saved by Allah's permission and Omnipotence.
Abraham [a] came out of this fire alive instead of being burnt to ashes. Yet, how was he saved against such fire? Only by a miracle performed by Allah to let people know that Abraham [a] was a messenger of the Almighty.
Another miracle is that concerning Prophet Muhammad [s] and his midnight journey to the seven heavens. His means were not by any form of transport, only the Omnipotence of Allah made him transcend. Another miracle of Prophet Muhammad [s] is the Holy Qur'an sent down to him by Allah, the Most High. It is impossible for others to compose anything like it, not even a single sentence of the profound text, neither during the Prophet's lifetime nor afterwards.
People, therefore, on hearing this great miracle (the Qur'an) not only believed him but also believed that it could only be the Word of Allah and not of man. If it was not so, other people could surely write something like it. But being Allah's, no one can bring anything to resemble the Qur'an. Only Allah, the Exalted.
Miracles are something extraordinary which no one is capable of doing and Allah specifies that the miracles of His prophets are only to make people trust and believe them.