And to Allah belongs whatever is in the heavens and whatever is on the earth: Meaning, He possesses all that in the most perfect manner—that is, by way of creation and ownership, and none other than Him, the Exalted and Majestic, shares in it at all, neither independently nor by association. This implies an action related to it.
And His saying, the Exalted: "That He may recompense those who did evil for what they did"—meaning, He created what is in them in order to recompense the astray with the punishment for what they committed of misguidance, which is expressed as "evil" to clarify its state, or with the like of what they did, or because of what they did. This is on the basis that the ba (in bima) links the recompense to an implied noun, or denotes causality without implying anything.
"And He may recompense those who did good"—meaning, those who were guided—"with the best [reward]"—that is, with the excellent recompense, which is Paradise, or with something better than their deeds, or because of their good deeds. This is a completion of what was stated previously, for when He, Glory be to Him, commanded him (the Prophet), peace and blessings be upon him, to turn away, He negated the illusion that this was because they would be left aimless. In shifting from the pronoun of "your Lord" to the All-Comprehensive Name (Allah) is that which establishes the increase of power, and that the speech is driven toward warning those who turn away; and that the setting in order of this great kingdom is for this wisdom; therefore, there must be one who is astray and one who is guided, and that each must receive what he deserves. It also contains the implication that he, may Allah’s blessings and peace be upon him, will receive the "best [reward]" as a recompense for his conveying [the message], while they will receive the "evil" as a recompense for their denial. He repeated the verb of recompensing to demonstrate the perfection of care and to alert [the listener] to the disparity between the two recompenses.
It is permissible that the meaning of "So turn away" is: do not confront them with their own conduct; entrust them to your Lord, for He is most knowing of you and of them, so He will recompense each with what he deserves. It is not hidden what is contained in the shift away from the two pronouns in "those who strayed" and "those who are guided," and [the interpretation of] making His saying, the Exalted, "That He may recompense" related to what is indicated by His saying, the Exalted, "Indeed, your Lord is most knowing"—meaning, He distinguished the astray from the guided and preserved their states "so that He may recompense..." and so on.
His saying, the Exalted, "And to Allah belongs the dominion of the heavens" is a parenthetical sentence that confirms the discourse that they will certainly be recompensed and will not be neglected. It is as if it were said: He, Glory be to Him, is most knowing of them, and they are under His dominion and power. Based on that meaning, it is permitted that "that He may recompense" relates to His saying, the Exalted, "And to Allah belongs whatever is in the heavens," as previously stated, to confirm the matter of the warning—meaning, He is most knowing of them, and He only arranged this kingdom for the sake of recompense. Some have preferred this meaning with the two aforementioned points, as it has passed.
It is also permitted that the sentence "And to Allah belongs whatever is in the heavens" is a circumstantial state (hal) from the doer of "most knowing," whether it is in the sense of "All-Knowing" or not. Regarding "that He may recompense," [some] relate it to "strayed" and "guided" on the basis that the lam is for the outcome—meaning, He, the Exalted, is "most knowing of who has strayed" so that his affair may lead to Allah, the Exalted, recompensing him by His knowledge, and "of who has been guided" so that his affair may lead to Him recompensing him with the best reward. This is clearly remote. Even more remote by stages is its relation to His saying, the Exalted, "Their intercession will not avail," as mentioned by Makki. Zayd ibn Ali recited it as linajziya (that We may recompense) and najziya (We recompense) with the nun in both.