O beloved We have indeed bestowed upon you countless excellences. So you offer Salah for your Lord, and sacrifice. Indeed he who is your enemy, only he is deprived of every good.[Kanz-ul-Iman (translation of Quran)]
Here is a holy reason for the revelation of this verse. When a beloved son of the Holy Prophet صلّی اللّٰہ علیہ واٰلہٖ وسلّم passed away, disbelievers like Abu Lahab, ‘Uqbah Bin Mu’eet, ‘Aas Bin Waa`il, etc. began to say hurtful words. Someone said,
‘The root of Muhammad (صلّی اللّٰہ علیہ واٰلہٖ وسلّم) has been cut off.’ Someone said, ‘Don’t mention Muhammad (صلّی اللّٰہ علیہ واٰلہٖ وسلّم). He is the sort of person whose root has been cut off. He does not have any male child. When he passes away, his name will be wiped off the face of the earth.’ Responding to these disbelievers and comforting His Beloved Prophet صلّی اللّٰہ علیہ واٰلہٖ وسلّم,
Almighty Allah revealed this Surah. It is as if Allah Almighty said, ‘O Beloved! Do not get grieved at what these people say. Look what benevolence and grace We have bestowed upon you. We have blessed you with countless qualities and bounties. Therefore, offer Salah and make sacrifice in gratitude. As far as your enemies are concerned, it is actually them whose root has been cut off. They are deprived of every good.’
In fact, as long as the world exists, every such person who blasphemes [i.e. shows disrespect to] the Holy Prophet صلّی اللّٰہ علیہ واٰلہٖ وسلّم is deprived of good and is included in this verse. This Surah is a wonderful proof of the dignity and the great rank of the Holy Prophet صلّی اللّٰہ علیہ واٰلہٖ وسلّم in the Divine court as well as of Divine love for him صلّی اللّٰہ علیہ واٰلہٖ وسلّم.
When disbelievers poked fun at him صلّی اللّٰہ علیہ واٰلہٖ وسلّم, Almighty Allah Himself replied on behalf of His Prophet that his enemy was deprived of good. This is actually a sign of affection. If anyone objects to one’s beloved, one replies to the objection himself.
A similar way of affection is found in many other places of the Holy Quran. For example, when Waleed Bin Mugheerah called the Holy Prophet صلّی اللّٰہ علیہ واٰلہٖ وسلّم insane and crazy, Almighty Allah mentioned nine of his faults in his denunciation. Almighty Allah also said to the Beloved Prophet صلّی اللّٰہ علیہ واٰلہٖ وسلّم, ‘By the grace of your Lord, you are not insane.’ (Part 29, Surah Al-Qalam, Ayah 2)