All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It appears that when Aasif ibn Barkhiyah informed that he can bring the throne of the Queen of Sheba, he said that because of his confidence that Allah will respond to his supplication and he was he had certitude and trust in Allah.
It was reported that Aasif knew the Great Name of Allah, which is the Name that Allah responds to the supplications when He asked by it (its virtue). Therefore, he supplicated Allah by its virtue, and Allah answered his supplication.
Answering his supplication is a kind of Karaamah (a supernatural ability that Allah grants to a righteous slave).
Awliyaa’ (pious people) may be certain that something will happen based on their trust that Allah will respond if they supplicate Him to make that thing happen; as in the Hadeeth narrated by Muslim which reads:
"Many a person with shaggy and dusty hair, driven away from doors (because of their poverty and appearance) if he were to swear by Allah (to make something happen), Allah will certainly make it happen (for him)."
Nevertheless, some scholars stated that the Karamaat of the Awliyaa’ is not done to challenge others and it does not happen by the person requesting it to happen, contrary to the miracles of the Prophets.
To conclude, the supernatural maters may happen by non-pious people, such as the magicians and charlatans; in which case, they are Satanic cases (supported by the devil). On the other hand, many of the great Awliyaa’ from the companions and those who came after them were not reported to have had Karamaat.
Therefore, one should not exaggerate the matter of supernatural abilities and the rank of the people to whom they happen. The occurrence of miracles is not evidence of the righteous of the person; just as the non-occurrence of these supernatural matters is not evidence of the corruption of the person. Rather, what matters is the righteousness of the person and his adherence to the Commands of Allah.
It should be noted that the supernatural matters that happened to the Prophets is what the scholars agreed to term as miracle, and what happens to the righteous people is what has been termed as Karaamah.
For more benefit, please refer to Fataawa 379981 and 370891.
Allah knows best.