In The Name of Allaah, The Most Merciful, the Bestower of Mercy
This is found in a number of Aayaat, that when the polytheists shunned the worship of Ar-Rahmaan [Allaah], they were put to trial through the worship of idols. And when they behaved haughtily and claimed that the Messengers were [only] humans [i.e. therefore they will not follow the Messengers], they were put to trial through submission to everything that made [their] intellects and Religion unstable.
And when Eemaan was clearly shown to them [i.e. the disbelieving nations] at the first instance and they recognised it, but then they turned away from it, Allaah [Glorified be He and free is He from all imperfections] averted, afflicted and sealed their hearts. So, they believed not until they saw the painful punishment.
And after the straight path was clarified for them, but they deviated from it by choice and approved the path of deviation in opposition to the path of guidance, Allaah deviated their hearts and caused them to be confounded in their path [of misguidance].
And when they belittled the signs of Allaah and His Messengers, Allaah belittled them with a humiliating punishment.
And when they behaved haughtily, Allaah humiliated them in this life and the next.
And when they forbade that Allaah’s Name be glorified and mentioned in the Mosques of Allaah and strive for their ruin, then it was not fitting after that they should enter it except in fear.
وَمِنْهُم مَّنْ عَاهَدَ اللَّـهَ لَئِنْ آتَانَا مِن فَضْلِهِ لَنَصَّدَّقَنَّ وَلَنَكُونَنَّ مِنَ الصَّالِحِينَ
فَلَمَّا آتَاهُم مِّن فَضْلِهِ بَخِلُوا بِهِ وَتَوَلَّوا وَّهُم مُّعْرِضُونَ
فَأَعْقَبَهُمْ نِفَاقًا فِي قُلُوبِهِمْ إِلَىٰ يَوْمِ يَلْقَوْنَهُ بِمَا أَخْلَفُوا اللَّـهَ مَا وَعَدُوهُ وَبِمَا كَانُوا يَكْذِبُونَ
And of them are some who made a covenant with Allaah (saying): ”If He bestowed on us of His Bounty, we will verily give Sadaqah (Zakat and voluntary charity in Allaah’s cause) and will be certainly among those who are righteous. ”Then when He gave them of His Bounty, they became niggardly [refused to pay the Sadaqah (Zakat or voluntary charity)], and turned away, averse. So He punished them by putting hypocrisy into their hearts till the Day whereon they shall meet him, because they broke that (covenant with Allaah) which they had promised to Him and because they used to tell lies”( 9:75-77)
The Aayaat that convey this affair are numerous and they show that the servant was close to being guided and made to follow the straight path, but then he abandoned it after knowing it, or he renounced it after following it, so he is punished and has no right to guidance. This is a recompense for his actions, as Allaah said about the Yahood [i.e. those who knew the truthfulness of Muhammad’s (sallal-laahu-alayhi-wasallam) Messengership, but turned away from it wilfully)]:
وَلَمَّا جَاءَهُمْ رَسُولٌ مِّنْ عِندِ اللَّـهِ مُصَدِّقٌ لِّمَا مَعَهُمْ نَبَذَ فَرِيقٌ مِّنَ الَّذِينَ أُوتُوا الْكِتَابَ كِتَابَ اللَّـهِ وَرَاءَ ظُهُورِهِمْ كَأَنَّهُمْ لَا يَعْلَمُونَ
وَاتَّبَعُوا مَا تَتْلُو الشَّيَاطِينُ عَلَىٰ مُلْكِ سُلَيْمَانَ
And when there came to them a Messenger from Allaah (i.e Muhammad) confirming what was with them, a party of those who were given the Scripture threw away the Book of Allaah behind their backs as if they did not know! They followed what the (devils) gave out (falsely of the magic) in the lifetime of Sulaymaan. 2:101-102
They abandoned the most sublime, the most beneficial and the truthful Book (i.e. the Qur’aan), so Allaah put them to trial and they followed the most debased, untruthful and harmful path. Those who wage war against Allaah and His Messenger abandon spending their wealth in obedience to Allaah, and (instead) spend it in obedience to shaytaan.
[Source: Al Qawaa-idul Hisaan Li-tafseer Al Qur’aan” by Imaam Abdur Rahmaan As-Sadi (rahimahullaah). Pages: 96-97. Abridged and slightly paraphrased]