Deeds are not just counted; deeds are weighed.
Allah says in Surat al-Bayyinah (98:5), “And they were not commanded except to worship Allah, [being] sincere to Him in religion, inclining to truth, and to establish prayer and to give zakah. And that is the way of the straight religion.”
‘Umar bin Al-Khattab narrated in Sahih al-Bukhari (hadith 54): that Allah’s Messenger (ﷺ) said, “The reward of deeds depends upon the intentions and every person will get the reward according to what he has intended. So whoever emigrated for Allah and His Prophet, then his emigration was for Allah and His Prophet. And whoever emigrated for worldly benefits or for a woman to marry, then his emigration was for what he emigrated for.”
What makes intentions so important? Good intentions are, by itself, rewarded for. They magnify the rewards of good deeds and they elevate the status of mubah actions to worship (for example, sleeping with the intention of waking up for prayer makes the former an act of worship).
Sufyan ibn Dinar asked Abu Bashir: Tell me about the deeds of those who came before us.
He responded: They used to do little but were rewarded greatly.
Sufyan ibn Dinar said: And why is that?
He answered: Due to the purity of their hearts.1
1Source unknown to me.