And the ones who disbelieve in the signs of Allah and the meeting with Him – those have despaired of My mercy, and they will have a painful punishment. ( Al-'Ankabut : 23)
O you who have believed, do not make allies of a people with whom Allah has become angry. They have despaired of the Hereafter just as the disbelievers have despaired of the companions of the graves. ( Al-Mumtahanah : 13)
These two verses say that the unbelievers have despaired of the mercy of Allah. But I can't figure out how it happened. Since, for example, there will be a righteous Jew or a Christian, or a monotheist - they will hope for the mercy of Allah, because they all believe in Him. So why does it say otherwise here?