39:51
فَأَصَابَهُمْ سَيِّـَٔاتُ مَا كَسَبُوا۟ ۚ وَٱلَّذِينَ ظَلَمُوا۟ مِنْ هَٰٓؤُلَآءِ سَيُصِيبُهُمْ سَيِّـَٔاتُ مَا كَسَبُوا۟ وَمَا هُم بِمُعْجِزِينَ
And the evil consequences of what they earned struck them. And those who have wronged of these [people] will be afflicted by the evil consequences of what they earned; and they will not cause failure.
Translation · Saheeh International
Tafsir
Ibn Kathīr (abridged)
How Man changes when He is blessed after suffering Harm
Allah tells us how man, when he is suffering from harm, prays to Allah, turning to Him in repentance and calling upon Him, but when He makes things easy for him, he transgresses and commits sins.
إِنَّمَآ أُوتِيتُهُ عَلَى عِلْمٍ
(Only because of knowledge I obtained it.) means, `because Allah knows that I deserve it; if it were not for the fact that Allah regards me as special, He would not have given me this.' Qatadah said, "Because I know that I deserve it." Allah says:
بَلْ هِىَ فِتْنَةٌ
(Nay, it is only a trial,) meaning, `the matter is not as he claims; on the contrary, We have blessed him with this as a test to see whether he will be obedient or disobedient -- although We have prior knowledge of that.' In fact, it is a trial.