A brief answer to this important question is that life is test, to see will we obey Allah or disobey Him. Not every amazing event performed by a person proves that he or she is guided by God. This is a very important matter.
Both in Islam and Christianity for example we are warned about the Dajjal, or anti Christ, who will do many amazing things, and will claim that he is the Lord, but as Muslim we know that this not true, because Allah is not a human!
This is why when some students of Iman Malik came to him and said: "We will not believe in someone or listen to what he says, until we first see if he is upon the true belief of the Prophet (saws), even if he walks upon water." Malik replied: "No, you have made this matter small. Even if you see him flying in the air don't accept him until you check his aqeeda."
Of course it may seem that sometimes the prayers of the disbelievers are accepted and sometimes the prayers of believers are rejected. This is the way that Allah tests us, and put us to trial. In fact those who worship other than Allah call upon that which cannot harm or help them, and prayers of the believers are most often responded to by Allah. Also sometimes the disbeliever may pray to Allah, as opposed to Jesus or their idol, and Allah responds to that prayer. Sometimes the "healings" and "miracles" that take place are in fact just tricks, either by humans or through the jinn.
I remember in Sri Lanka there was a Buddhist who had converted to Islam who remembered that when she was a child and her parents took her to pray to a statue of Buddha during a particular festival. They were offering the statue drink and it was drinking. She heard a noise from the back of statue and wandered in that direction, and found a pump and pipe going into the back of the statue, then her mum shouted at her to come back!
There is an athaar that tell us that one day Abdullah ibn Mas’ud came to his house and found his wife wearing an amulet round her neck. “Shirk in the house of Abdullah ibn Mas’ud!” he said, pointing to the amulet. “I had a twitch in my eye and went to certain Jew, he gave me this and the twitch stopped” replied his wife.
“It was only a devil that was pocking your eye and when you made shirk he left you!”
Similarly with prophecies. These could either be tricks, lies, general predictions or inspiration from the Shaiteen which they "steal" from listening to the Angels in the heavens but the mix with lies. People conveniently remember only the things that come true. The way to expose the falsehood of such claims is of course to point out how many of these "prophecies" have not come true. In fact the bible says:
"If what a prophet proclaims in the name of the LORD does not take place or come true, that is a message the LORD has not spoken. That prophet has spoken presumptuously. Do not be afraid of him." Deut 18:22
For example Joseph Rutherford a carismatic leader of the Jehova's Witnesses predicted
that "1925 will mark the return of Abraham, Isaac, Jacob and the
faithful prophets of old" (Millions Now Living Will Never Die,
pp. 89-90). In 1929 Rutherford even had a house built in San Diego,
California for the tardy prophets who were already running four years
You will find many "propehts" suffering from the same problems. Meaning their prophecies fail to come true!
So through such matters the disbelievers are lead further astray from Allah’s path. Allah makes easy for those who wish guidance to be guided and for those who choose to go astray they find that which they imagine justifies their error in their minds. The truth, however, is clear and distinct from the falsehood, and Allah always makes the truth known in the end.