This is the most detailed and fascinating story in the Qur'an, involving both human weaknesses such as jealousy, hatred, pride, passion, deception, intrigue, cruelty, terror as well as noble qualities such as patience, loyalty, bravery, nobility, and compassion.
It is related that among the reasons for its revelation is that the Jews asked the Prophet Muhammad to tell them about Joseph , who was one of their old prophets. His story had been distorted in parts and marred in others with interpolations and exclusions. Therefore it was revealed in the Book of Allah (Qur'an), complete in its minute and careful details.
Allah the Almighty declared: We relate unto you (Muhammad) the best of stories through Our Revelations unto you, of this Qur'an. And before this (i.e. before the coming of Divine Inspiration to you), you were among those who knew nothing about it (the Qur'an). Surah 12: 3
Almighty Allah also decreed: Thus We relate to you (0 Muhammad) some information of what happened before. And indeed We have given you from Us a Reminder (this Qur'an). Whoever turns away from it (this Qur'an - i.e. does not believe in it, nor acts on its orders), verily, they will bear a heavy burden (of sins) on the Day of Resurrection. They will abide in that (state in the Fire of Hell), and evil indeed will it be that load for them on the Day of Resurrection. Surah 20:99-101
The story of Joseph moves in a stream from beginning to end; its substance and form are equally coherent. It inspires you with a feeling for the depth of Allah's power and supremacy and the execution of His rulings despite the challenge of human intervention. And Allah has full power and control over His Affairs, but most of men know not. Surah 12: 21
This is what the story of Joseph confirms categorically, for it ends with comfort and marvels.
Summary of Joseph's Story
Joseph lived all his life confronting schemes made by the people closest to him. His brothers plotted to kill him, but they amended it to exiling him. This happened to him while he was a boy. He was sold into the slave market in Egypt, where he was bought for a nominal sum. Then he fell victim to the attempted seduction by a great man's wife who, when her wish was foiled, sent him to prison, where he remained for some time. In spite of all this, he at length approached close to the Egyptian throne and became the king's chief minister. He then began his call to Allah from the position of the ruling authority.
Allah's plans were carried out, and the matter ended. This is the substance (theme) of the story. As for the form (style) in which it is presented, it is a landmark of wonder.