لَا تَحْسَبَنَّ الَّذِينَ يَفْرَحُونَ بِمَا أَتَواْ وَّيُحِبُّونَ أَن يُحْمَدُواْ بِمَا لَمْ يَفْعَلُواْ
Think not that those who rejoice in what they have done, and love to be praised for what they have not done,
refers to those who show off, rejoice in what they do and claim to do what they have not done.
The Two Sahihs recorded that the Prophet said,
مَنِ ادَّعَى دَعْوَةً كَاذِبَةً لِيَتَكَثَّرَ بِهَا لَمْ يَزِدْهُ اللهُ إِلاَّ قِلَّة
Whoever issues a false claim to acquire some type of gain, then Allah will only grant him decrease.
The Sahih also recorded;
الْمُتَشَبِّعُ بِمَا لَمْ يُعْطَ كَلَبِسِ ثَوْبَيْ زُور
He who claims to do what he has not done, is just like a person who wears two robes made of falsehood.
Imam Ahmad recorded that;
Marwan told his guard Rafi to go to Ibn Abbas and proclaim to him, "If every person among us who rejoices with what he has done and loves to be praised for what he has not done will be tormented, we all will be tormented."
Ibn Abbas said, "This Ayah was revealed about the People of the Scriptures."
He then recited the Ayah,
وَإِذْ أَخَذَ اللّهُ مِيثَاقَ الَّذِينَ أُوتُواْ الْكِتَابَ لَتُبَيِّنُنَّهُ لِلنَّاسِ وَلَا تَكْتُمُونَهُ فَنَبَذُوهُ وَرَاء ظُهُورِهِمْ وَاشْتَرَوْاْ بِهِ ثَمَناً قَلِيلً فَبِيْسَ مَا يَشْتَرُونَ
(And remember) when Allah took a covenant from those who were given the Scripture (Jews and Christians) to make it (the truth) known and clear to mankind, and not to hide it, but they threw it away behind their backs, and purchased with it some miserable gain! And indeed worst is that which they bought. (3;187)
then the Ayah,
لَا تَحْسَبَنَّ الَّذِينَ يَفْرَحُونَ بِمَا أَتَواْ وَّيُحِبُّونَ أَن يُحْمَدُواْ بِمَا لَمْ يَفْعَلُواْ
Think not that those who rejoice in what they have done, and love to be praised for what they have not done.
Ibn Abbas said,
"The Prophet asked them about something, and they hid its knowledge, giving him an incorrect answer. They parted after showing off and rejoicing in front of him because they answered him, so they pretended, and they were delighted that they hid the correct news about what he had asked them."
This was recorded by Al-Bukhari, Muslim, At-Tirmidhi and An-Nasa'i.
Al-Bukhari recorded that Abu Sa`id Al-Khudri said,
"During the time of the Messenger of Allah, when the Messenger would go to battle, some hypocrite men would remain behind and rejoice because they did not accompany the Prophet in battle. When the Messenger would come back, they would ask him to excuse them swearing to having some excuse, and wanting to be praised for that which they did not do. So Allah revealed,
لَا تَحْسَبَنَّ الَّذِينَ يَفْرَحُونَ بِمَا أَتَواْ وَّيُحِبُّونَ أَن يُحْمَدُواْ بِمَا لَمْ يَفْعَلُواْ
Think not that those who rejoice in what they have done, and love to be praised for what they have not done),"
to the end of the Ayah."
And Muslim recorded similarly.
Allah said;
فَلَ تَحْسَبَنَّهُمْ بِمَفَازَةٍ مِّنَ الْعَذَابِ
think not that they are rescued from the torment,
Do not think that they will be saved from punishment, rather it will certainly strike them.
So Allah said;
وَلَهُمْ عَذَابٌ أَلِيمٌ
and for them is a painful torment.
Allah then said,
وَلِلّهِ مُلْكُ السَّمَاوَاتِ وَالَارْضِ وَاللّهُ عَلَىَ كُلِّ شَيْءٍ قَدِيرٌ