The subject matter of Surah Yousuf in this verse indicates that this Surah was revealed during the last stage of the Holy Prophet’s (Sallellahu Alaihi Wa Sallam) residence at Makkah, when the Quraish tribe were considering whether to kill the prophet (S.A.W.S.), exile him or imprison him.
“They said: “Are you indeed Yoosuf (Joseph)?” He said: “I am Yoosuf (Joseph), and this is my brother (Benjamin). Allah has indeed been gracious to us. Verily, he who fears Allah with obedience to Him (by abstaining from sins and evil deeds, and by performing righteous good deeds), and is patient, then surely, Allah makes not the reward of the Muhsinoon (good-doers)to be lost.”
[Quran (Surah Yousuf, Verse 90)]
Some of the unbelievers put this question (probably at the instigation of the Jews) to test him :”Why did the Israelites go to Egypt?” This question was asked because they knew that their story was not known to the Arabs for there was no mention of it whatever in their traditions and the Holy Prophet (S.A.W.S.) had never even referred to it before. Therefore they expected that he would not be able to give any satisfactory answer to this question or would first evade it, and afterwards try to inquire about it from some Jew, and thus he would be totally exposed. But, contrary to their expectations, the tables were turned on them, for Allah revealed the whole story of Prophet Yousuf (A.S.) then and there, and the Holy Prophet (S.A.W.S.) recited it on the spot. This put the Quraish in a very awkward position because it not only foiled their scheme but also administered a warning to them by aptly applying it to their case, as if to say, “As you are behaving towards this Prophet, exactly in the same way the brothers of Prophet Yousuf (A.S.) behaved towards him; so you shall meet with the same end.”
This Surah was sent down for two objectives:
1. To give the proof of the Prophethood of Muhammad (Sallellahu Alaihi Wa Sallam), demanded by the opponents themselves so as to prove conclusively that his knowledge was not based on mere hearsay, but was gained through Revelation. This aspect has been stated explicitly in its introductory verses and explained plainly in its concluding portion.
2. To apply it to the Quraish and warn them that ultimately the conflict between them and the Holy Prophet (S.A.W.S.) would end in his victory over them. As they were then persecuting their brother, the Holy Prophet (S.A.W.S.), in the same way the brothers of Prophet Yousuf (A.S.) had treated him. The Quraish were told indirectly that they would also fail in their evil designs just as the brothers of Prophet Yousuf (A.S.) had failed in his case, even after casting him into the well. This is because none has the power to defeat the Divine will. And just as the brothers of Prophet Yousuf (A.S.) had to humble themselves before him, so one day the Quraish shall have to beg forgiveness from their brother whom they were then trying to crush down. This, too, has been made quite plain in verse. 7:
“Indeed there are signs in this story of Yousuf and his brothers for these inquirers from among the Quraish.”
[Quran (Surah Yousuf, Verse 7)]
Reflections from this verse:
Prophet Yousuf (A.S.) revealed his identity to his brothers when they told him about the afflictions and hardship, and shortages in food they suffered from in the aftermath of the drought that struck them.
Prophet Yousuf (A.S.) remembered his father’s grief for losing his two children and felt compassion, pity and mercy for his father and brothers, especially since he himself was enjoying kingship, authority and power.
He reminded his brothers of the tremendous sin they were about to commit out of ignorance.
He made his brothers aware of Allah’s graciousness to them by gathering them together after they had been separated for a long time.
Prophet Yousuf (A.S.) is conscious only of Allah’s reward to those who have Taqwa and patience.
He is not conscious of his own magnanimity in forgiving his brothers and accepting them in spite of the harm they had caused him.
The brothers of Prophet Yousuf (A.S.) realized and affirmed Yusuf’s (A.S.) virtue above them, being blessed with beauty, conduct, richness, kingship, authority and, above all, prophethood. They admitted their error and acknowledged that they had made a mistake against him.
When the affliction becomes harder, Allah sends His relief from that affliction.
(References: Tafhim al-Qur’an and Tafsir Ibn Kathir)