"And whoever obeys Allah" by submitting to His command and prohibition, "and the Messenger" who conveys what has been revealed to him from Allah by following his legislation and being pleased with his judgment. This is a new sentence, containing a superior encouragement toward obedience and increasing the yearning for it by explaining that its result is the furthest limit that the aspirations of nations can reach, the highest point toward which the necks of their desires extend, and toward which the eyes of their resolves gaze: namely, the companionship of the greatest of all creation in stature, the highest of them in station. It also contains an explanation of what was ambiguous and a detailed account of what was generalized in the answer to the preceding conditional sentence.
"And" (من) is conditional. The singular pronoun in "obeys" (يطع) observes the form, while the plural in His saying "those" (فأولئك) observes the meaning—that is, the obedient ones whose rank has ascended and whose station has become distant in honor and excellence—"with those upon whom Allah has bestowed favor"—a favor for which language falls short of detailing and explaining—"among the prophets." This is an elaboration of those favored; it is a state (hal), either from "those" (referring to the obedient ones as being alongside them while they are from the prophets), or from its pronoun.
The reason for mentioning the companionship of the prophets specifically, rather than our Prophet (may Allah bless him and grant him peace), despite the discourse being in clarification of the ruling of obeying him (peace be upon him), is because they were mentioned in the sabab al-nuzul (occasion of revelation), with an indication that obeying him includes obeying them. At-Tabarani, Abu Nu'aym, and Ad-Diya' al-Maqdisi reported—and classified it as hasan—that a man came to the Prophet (may Allah bless him and grant him peace) and said: "O Messenger of Allah, you are dearer to me than my own soul, and you are dearer to me than my children. I am in my house, and I remember you, so I cannot endure until I come and look at you. When I think of my death and your death, I know that when you enter Paradise, you will be raised with the prophets, and I fear that when I enter Paradise, I will not see you." The Prophet (may Allah bless him and grant him peace) did not reply to him until Gabriel descended with this verse: "And whoever obeys Allah..." and so on. A similar report is narrated from Ibn Abbas.
Al-Kalbi said: Thawban, the freed slave of the Messenger of Allah (may Allah bless him and grant him peace), loved him intensely and had little patience when away from him. His body withered and his complexion changed out of fear that he would not see the Prophet (may Allah bless him and grant him peace) after death. He mentioned this to the Messenger of Allah (may Allah bless him and grant him peace), and Allah the Almighty revealed this verse. From Masruq: The companions of the Messenger of Allah (may Allah bless him and grant him peace) said, "It is not fitting that we should be separated from you in the world, for if you depart from us, you will be raised above us." Thus, this was revealed. He began by mentioning the prophets because of their exalted rank and their superiority over others.
Al-Sha'rani reported from our master, the Great Shaykh (may Allah sanctify his secret), that he said: "A space the size of a needle's eye from the station of Prophethood was opened for me—a manifestation, not an entry—and I nearly burned up." Then He (the Almighty) turned toward them by way of descent, saying: "and the truthful, and the martyrs, and the righteous." The stations are four, one below the other:
The first are the stations of the Prophets. They are those who are sustained by a divine power, accompanied by a soul in the highest ranks of sanctity. Their likeness is that of one who sees a thing face-to-face, from nearby. Therefore, Allah the Almighty said regarding the attribute of our Prophet (may Allah bless him and grant him peace): "Will you then dispute with him over what he sees?"
The second are the stations of the Truthful (Siddiqin). They are those who follow after the prophets (peace be upon them) in knowledge. Their likeness is that of one who sees a thing face-to-face, from afar. This is what 'Ali (may Allah honor his face) meant when it was asked of him, "Have you seen your Lord?" He replied, "I would not worship a Lord I have not seen." Then he added, "The eyes do not see Him with the witnesses of physical sight, but the hearts see Him with the realities of faith."
The third are the stations of the Martyrs (Shuhada). They are those who know the thing through proofs. Their likeness is that of one who sees a thing in a mirror from a close place, similar to the state of the one who said: "It is as if I am looking at the Throne of my Lord, unveiled." This is what the Prophet (may Allah bless him and grant him peace) intended by his saying: "Worship Allah as if you see Him."
The fourth are the stations of the Righteous (Salihin). They are those who know the thing through firm imitation (taqlid). Their likeness is that of one who sees a thing from afar in a mirror. This is what the Prophet (may Allah bless him and grant him peace) intended by his saying: "For if you do not see Him, He sees you." This was stated by Al-Raghib and quoted by Al-Tibi and others.
[Regarding the companionship in Paradise]: It is not meant by "companionship" the unity of rank, nor an absolute participation in entering Paradise, but rather that they are in it in such a way that each one of them is able to see the other and visit him whenever he wishes, even if the distance between them is great. Many have mentioned that there is no impediment to the lower being raised to the station of the higher whenever he wishes as an honor to him, then returning; and he does not see that there is anyone living more comfortably than him or more complete in pleasure, lest there be sorrow in his heart. Likewise, there is no impediment to the higher descending to the station of the lower, then returning, without seeing that as a deficiency in his sovereignty or a lowering of his status.
"And how excellent are those as companions!" That is, as a partner, derived from rifq (gentleness), which is softness of side and pleasantness in social interaction, both in word and deed. The "and" in "how excellent" (wa hasuna) on one probability may be for exclamation, as if it were said: "How excellent are those as companions!"