He related from the Messenger of Allah ﷺ that when a disbeliever performs a good deed, he is given sustenance for it in this world. As for the believer, Allah stores up his good deeds for him in the hereafter and grants him provision in this world as a consequence of his obedience.
أنه حدث عن رسول الله ﷺ: إن الكافر إذا عمل حسنة أطعم بها طعمة من الدنيا، وأما المؤمن فإن الله يدخر له حسناته في الآخرة، ويعقبه رزقا في الدنيا على طاعته.
Muslim narrated it in Sifat al-Qiyama (57:2808), from Asim bin Nadr Taymi, who said, Mutamir related to us, he said, I heard my father, Qatada related to us, from Anas bin Malik, and he mentioned it.