At the beginning of his preaching activity, or shortly before it, Mohammed adopted a slave named Zaynab bint Jahsh, whom he received as a gift from his wife Khadija. Some years later, Mohammed arranged the marriage between Zayd and his cousin Zaynab bint Jahsn, who was reluctant at first but eventually agreed to it with a little help from a right-on-target revelation:
It is not for a believing man or a believing woman, when Allah and His Messenger have decided a matter, that they should [thereafter] have any choice about their affair. And whoever disobeys Allah and His Messenger has certainly strayed into clear error. (Quran 33:36)
One day Mohammed realised how beautiful Zaynab was and fell in love with her. Al-Tabari describes the episode in the biography:
The Messenger of God came to the house of Zayd b. Harithah. (Zayd was always called Zayd b. Muhammad.) Perhaps the Messenger of God missed him at that moment, so as to ask, “Where is Zayd?” He came to his residence to look for him but did not find him. Zaynab bt. Jash, Zayd’s wife, rose to meet him. Because she was dressed only in a shift, the Messenger of God turned away from her. She said: “He is not here, Messenger of God. Come in, you who are as dear to me as my father and mother!” The Messenger of God refused to enter. Zaynab had dressed in haste when she was told “the Messenger of God is at the door.” She jumped up in haste and excited the admiration of the Messenger of God, so that he turned away murmuring something that could scarcely be understood. However, he did say overtly: “Glory be to God the Almighty! Glory be to God, who causes the hearts to turn!” When Zayd came home, his wife told him that the Messenger of God had come to his house. Zayd said, “Why didn’t you ask him to come in?” He replied, “I asked him, but he refused.” “Did you hear him say anything?” he asked. She replied, “As he turned away, I heard him say: ‘Glory be to God the Almighty! Glory be to God, who causes hearts to turn!’”
So Zayd left, and having come to the Messenger of God, he said: “Messenger of God, I have heard that you came to my house. Why didn’t you go in, you who are as dear to me as my father and mother? Messenger of God, perhaps Zaynab has excited your admiration, and so I will separate myself from her.” Zayd could find no possible way to [approach] her after that day. He would come to the Messenger of God and tell him so, but the Messenger of God would say to him, “Keep your wife.” When Zaid mentioned his intention to separate from Zainab to the prophet, the prophet told him, “Retain thou thy wife” even though the prophet desired that they separate so that he could marry her. Zayd separated from her and left her, and she became free. (The History of Al-Tabari: The Victory of Islam, translated by Michael Fishbein [State University of New York Press, Albany, 1997], Volume VIII, pp. 2-3)
That is confirmed in Surah 33:37:
And [remember, O Muhammad], when you said to the one on whom Allah bestowed favour and you bestowed favour, “Keep your wife and fear Allah”, while you concealed within yourself that which Allah is to disclose.[…] (Quran 33:37)
Mohammed found himself in a rather awkward situation. As much as he craved to marry Zaynab, he was worried about what people might think because this event gave rise to the issue of legally marrying the former wife of an adoptive son, since the latter had rejected her. Through this very targeted revelation (Quran 33:37) we can see how Mohammed got out of the moral and legal trouble and managed to get away with it. Here is what Al-Tabari says:
Once he departed from the prophet, Zayd divorced from Zaynab. When the legal term was done, she let the prophet know: “Zayd divorced from me because of you, so that you can finally marry me”. The prophet was craving this marriage but was embarrassed and didn’t respond. Allah saw this embarrassment and therefore gave him Zaynab for his wife by revealing the verse: And [remember, O Muhammad], when you said to the one on whom Allah bestowed favor and you bestowed favor, “Keep your wife and fear Allah ,” while you concealed within yourself that which Allah is to disclose. And you feared the people, while Allah has more right that you fear Him. So when Zayd had no longer any need for her, We married her to you in order that there not be upon the believers any discomfort concerning the wives of their adopted sons when they no longer have need of them. And ever is the command of Allah accomplished. (Quran 33:37).
The prophet then said: “who will give Zaynab the good news?”. Aisha wasn’t happy about this, but the Prophet said to her: “dare you oppose God’s will?”. A woman went to tell Zaynab, who in turn got rid of all her jewels and gave them to her as a gift. Then she got to him because of the marriage that God in heaven ordained for him, as it is written in the Quran: “So when Zayd had no longer any need for her, We married her to you”. Zaynab glorified herself for these words and told the other wives of the prophet: “The prophet married you but it was God to get me married with the prophet”. Zaynab’s marriage took place in the month of Muharram in the fifth year of the Hijra. In the early first Rabī‘ month, the prophet would then leave for the Dūmat al-Ğandal expedition.
In the general awkwardness, the verse 33:38 “came” down to point out Mohammed’s honesty and get him out of trouble. The verse states that the marriage was imposed by Allah, not Mohammed:
There is not to be upon the Prophet any discomfort concerning that which Allah has imposed upon him. [This is] the established way of Allah with those [prophets] who have passed on before. And ever is the command of Allah a destiny decreed. (Quran 33:38).
More verses were then revealed to sweep away any doubt on the lawfulness of the marriage between Mohammed and his adoptive son’s wife. How did it work? That’s pretty simple: every adoption was called off and therefore Zayd’s status changed, from “adoptive son” to “former adoptive son”.
The deceivers were saying “Mohammed forbids us to marry our daughters in law, while he himself marries the wife of his son Zayd”. Abdullah Ibn Umar said, “We kept calling him Zayd Ibn Mohammed until the verse “Muhammad is not the father of any one of your men” was revealed”:
Muhammad is not the father of [any] one of your men, but [he is] the Messenger of Allah and last of the prophets. And ever is Allah , of all things, Knowing. (Quran 33:40)
Allah has not made for a man two hearts in his interior. And He has not made your wives whom you declare unlawful your mothers. And he has not made your adopted sons your [true] sons. That is [merely] your saying by your mouths, but Allah says the truth, and He guides to the [right] way. (Quran 33:4)
Finally, through the help of Allah, Mohammed succeeded in marrying Zaynab, the rejected wife of his former adoptive son.