First of all, we have to know about who is wali in the eyes of Shari`ah. There are many people who think of themselves as walis, though they are very far from the way of Allah and His Prophet (peace be upon him).
Late Sheikh `Atiyyah Saqr, former head of Al-Azhar Fatwa Committee, stated:
the term Wali stands for anyone who fulfils the obligations Allah has levied on him, and as such he is protected by Allah on that basis. Allah says in the Qur’an: (Lo! verily the friends of Allah are (those) on whom fear (cometh) not, nor do they grieve! Those who believe and keep their duty (to Allah). ) (Yunus: 62- 64)
In these verses, Allah Almighty describes the Wali as he who is amongst (those who believe and keep their duty (to Allah).) That means he fulfills his obligations and carries out what Allah has ordained on him. Keeping one’s duty to Allah means to comply with His commands and stay away from what He forbids in all aspects of life: Islamic rituals, manners, business dealings, etc.
the reward of that commitment to Allah is also mentioned in the verse: < b>(On whom fear (cometh) not, nor do they grieve) meaning that they should not worry about their future, nor regret their past. Allah states elsewhere: (Theirs are good tidings in the life of the world and in the Hereafter.) (Yusus: 64) This indicates that Allah has protected them and taken care of their life and even the Hereafter (by granting them abundant reward).
It becomes clear that the main attributes of a wali is his extensive adherence to the principles of faith and abiding by the commands of the Prophet (peace be upon him). He is not haughty or arrogant but his humble and cooperative character helped him gain love of people and most important Allah’s love to him.
then, we come to discuss what you inquire about, which is the wali having a miraculous power. We maintain that it is admitted that all human beings are the same in terms of capability and power. Almighty Allah has created people at nearest levels of intelligence, health, beauty, etc. He does not endow someone with a supernatural power with which he can affect others, even if he is a messenger of Him. Allah (glory be to Him) said in the Qur’an while addressing His Messenger Muhammad (peace be upon him):
( Say: For myself I have no power to benefit, nor power to hurt, save that which Allah willeth. Had I knowledge of the Unseen, I should have abundance of wealth, and adversity would not touch me. I am but a warner, and a bearer of good tidings unto folk who believe. )(Al-A`raf, 7:188).
thus, the verse indicates that the Prophet has no power to benefit or hurt for himself, except that which Allah willed for him, referring to the normal competence given to every person. The verse also reveals that good deeds, no matter how much are they, furnish such a person with no power except the power of faith by which Allah guides him to right matters not a power to oppress or wrong others, nor a power to do miraculous things.
There is something that is called “Karamah” which refers to an abnormal matter that may occur at the hands of pious people by the help of Allah. This karamah is not a superficial power with which pious people is endowed, but it is the response of Allah to the supplications of the devout. A matter can be unattainable in the eyes of people, but nothing is beyond Allah’s Omnipotence, so Allah answers the supplication of such a person and helps him. For example, Allah may help a small group of Muslim fighters gain victory over a huge army or disable the weapons of the enemy due to the supplications of the righteous Muslims. This is the karamah.
as for the verse you referred to, scholars differed concerning this man. Some of them maintain he was a man and he was perfect in religious knowledge and in obedience of Allah, so he asked Allah to bring this throne to Sulaiman (Solomon) and Allah accepted his supplication and brought the throne to them. However, other scholars say that this one was Jibril (Gabriel) the angle.
thus, we have to repeat that karamah is not a supernatural power. Rather, it is Allah’s response to the supplications of a righteous person (a real wali).
May Allah guide all of us to what pleases Him!