The Quran states: “Whosoever does righteous good deed, it is for (the benefit of) his ownself; and whosoever does evil, it is against his ownself. And your Lord is not at all unjust to (His) slaves.” (46:41 Fussilat)
Narrated Abu Musa (rtam), the Prophet (sa) said: “The example of Muslims, Jews and Christians is like the example of a man who employed labourers to work for him from morning till night for specific wages. They worked till mid-day and then said: ‘We do not need your money which you have fixed for us and let whatever we have done be annulled.’
The man said to them: ‘Don’t quit the work, but complete the rest of it and take your full wages.’ But they refused and went away (like the Jews who refused to believe in the Message of Jesus (as))
The man employed another batch after them and said to them: ‘Complete the rest of the day and yours will be the wages I had fixed for the first batch.’ So, they worked till the time of Asr prayers. They said: ‘Let what we have done be annulled and keep the wages you have promised us for yourself!’
The man said to them: ‘Complete the rest of the work, as only a little of the day remains.’ But they refused (like the Christians who refused to believe in the message of Muhammad (sa)).
Thereafter he employed another batch to work for the rest of the day and they worked for the rest of the day till the sunset, and they received the wages of the two former batches. So that was the example of these people (Muslims) and the example of this light (The Quran and the Sunnah) and the guidance which Prophet (sa) brought which they have accepted willingly.” (Bukhari)
The Jews refused to believe in the message of Jesus (as), so all their work was annulled; similarly the Christians refused to accept the Message of Muhammad (sa) and thus their work was annulled too. Such people were not rewarded, because they refused to have true Faith for the rest of their lives and died as disbelievers.
They should have believed in the latest Message; for their insistence on keeping their old religion deprived them of the reward which they would have got for their previous good deeds achieved before the advent of the new religion. On the other hand, Muslims accepted and believed in all the three Messages and deserved a full reward for their complete surrender to Allah. (Al-Qastalani)