Fussilat: (25) "And We appointed for them companions..."
(And We appointed for them) meaning: We ordained for them, and in Al-Bahr it is said: We assigned to them [companions] from where they did not anticipate. It is also said: We empowered and set over them (companions) which is the plural of qarin (companion), meaning: associates and partners from the deviants of the Jinn. It is further said: [companions] from among them and from among mankind, who take hold of them—a seizure like the qayd (the shell) upon the egg. It is also said that the origin of qayd is exchange, from which comes muqayada (bartering) for compensation; thus, the appointment of the companion for the person is either for his taking hold of him or for his being taken as a substitute for others among his companions.
(So they made attractive to them) meaning: they made seem fair and established within their souls (what was before them) Ibn Abbas said: [this refers to] the matter of the Hereafter, as they cast into them [the notion] that there is no Paradise, no Fire, and no Resurrection. (And what was behind them) [refers to] the matter of this world, [consisting of] misguidance, disbelief, and following desires. Al-Hasan said: "What was before them" is the matter of this world, and "what was behind them" is the matter of the Hereafter. Al-Kalbi said: "What was before them" are their deeds which they witness, and "what was behind them" is what they are to do in the future, and for each is a direction. Perhaps the best [explanation] is what was narrated from Al-Hasan.
(And the word came into effect upon them) meaning: the word of punishment was established and confirmed against them, and its cause and fulfillment were realized, which is the saying of the Exalted to Iblis: "The Truth [is], and the Truth I say—that I will surely fill Hell with you and those who follow you among them, all together."
(Among nations) this is a state (hal) of the genitive pronoun; meaning: being [among] a group of nations. It is also said that "in" (fi) is in the sense of "with" (ma'a), and both meanings are supported by the verse: "If you are turned away from the best of conduct, then [you are] among others who have been turned away." In Al-Bahr, it is stated that there is no need for assuming an inclusion of meaning while the meaning of "in" is sound. The indefiniteness of (nations) is for the purpose of multiplication, meaning: among many nations (that had passed before them) meaning: that had gone by before them among the Jinn and Mankind in disbelief and disobedience, like the habit of these [people]. (Indeed, they were the losers.)
(Indeed, they were the losers) This is a justification for their deserving of the punishment. The pronoun refers to them and to the nations; it is permitted that it refers only to them by the context of the passage.