so that He may reward you for it
لِيجازيَكم به
This sentence is declarative, but it carries a great meaning. The purpose of this sentence is not for us to know or realize that Allah knows what we do, but rather it is a warning against doing what contradicts His Shari'ah, either by falling into what is prohibited or by neglecting what is commanded. And His saying, the Exalted:
knows that which you do.
يعلم ما تصنعون [Al-'Ankabut 29:45]
not
ما
is a relative pronoun indicating generality, encompassing everything we do, whether in speech or action, in what concerns His rights and in what concerns the rights of His servants.
He knows what you do
يعلَم ما تصنعون
He said:
"so that He may reward you for it" This outcome is clear. When does the recompense for it occur? In this world and on the Day of Resurrection. The recompense for it—meaning for what we do—may be legal, carried out by the servant, or it may be cosmic, carried out by Allah. Legal recompense carried out by the servant is like the hudud (fixed punishments), for the hudud are a legal punishment. Are they cosmic or legal? They are legal, carried out by the servant who is commanded to carry them out. And it may be cosmic, by the decree of Allah, carried out by Allah, such as if a person is afflicted with diseases, or his wealth is destroyed, or the like of that.
And Allah knows that which you do.
والله يعلم ما تصنعون [Al-'Ankabut 29:45]