Allah strikes a parable in surah al-Noor when He says:
وَالَّذِينَ كَفَرُوا أَعْمَالُهُمْ كَسَرَابٍ بِقِيعَةٍ يَحْسَبُهُ الظَّمْآنُ مَاءً حَتَّىٰ إِذَا جَاءَهُ لَمْ يَجِدْهُ شَيْئًا وَوَجَدَ اللَّهَ عِندَهُ فَوَفَّاهُ حِسَابَهُ ۗ وَاللَّهُ سَرِيعُ الْحِسَابِ
And those who disbelieve, their deeds are like a mirage on a flat expanse of land. A thirsty person thinks it is water until, when he reaches it, he finds that it is nothing. But he finds Allah in front of Him, and He will then pay him his due. And Allah is quick in reckoning. [24:39]
Commenting on this, al-Qurtubi wrote:
وهذا مثل ضربه الله تعالى للكفار ، يعولون على ثواب أعمالهم فإذا قدموا على الله تعالى وجدوا ثواب أعمالهم محبطة بالكفر ؛ أي لم يجدوا شيئا كما لم يجد صاحب السراب إلا أرضا لا ماء فيها ؛ فهو يهلك أو يموت
Allah struck this parable regarding the disbelievers; they are confident that they will be rewarded for their actions, but then when they come before Allah, they find that the rewards of their actions were nullified by disbelief. In other words, they do not find anything there, just as the person chasing a mirage only finds land with no water and will therefore perish or die.