Views of the scholars and doctors on the role of the man’s water and the woman’s water in determining the gender of the foetus
Question

Muslim (315) narrated that Thawbaan, the freed slave of the Messenger of Allah (blessings and peace of Allah be upon him) said:
I was standing beside the Messenger of Allah (blessings and peace of Allah be upon him) when one of the Jewish rabbis came and said: Peace be upon you, O Muhammad. I gave him a shove that almost made him fall over and he said: Why did you push me? I said: Why don’t you say, O Messenger of Allah? The Jew said: We only call him by the name that his family gave him. The Messenger of Allah (blessings and peace of Allah be upon him) said: “My name is Muhammad, that my family gave to me.” The Jew said: I have come to ask you something. The Messenger of Allah (blessings and peace of Allah be upon him) said: “Will it benefit you anything if I tell you?” He said: I will listen. The Messenger of Allah (blessings and peace of Allah be upon him) scratched the ground with a stick that he had with him and said: “Ask.” The Jew said: Where will the people be on the Day when the earth is changed to another earth and the heavens (likewise)? The Messenger of Allah (blessings and peace of Allah be upon him) said: “They will be in darkness near the bridge.” He said: Who will be the first people to cross (the bridge)? He said: “The poor muhaajireen.” The Jew said: What will be presented to them when they enter Paradise? He said: “The choicest pieces of whale’s liver.” He said: What food will be given to them after that? He said: The bull of Paradise, which used to graze along its edges, will be slaughtered for them.” He said: What will their drink be? He said: “From a spring there that is called Salsabeel.” He said: You have spoken the truth. I came to ask you about something that no one on earth knows except a Prophet or one or two men. He said: “Will it benefit you anything if I tell you?” He said: I will listen. I have come to ask you about the child. He said: “The water of the man is white and the water of the woman is yellow. If they meet and the maniy of the man prevails over the maniy of the woman, it will be a male, by Allah's leave. If the maniy of the woman prevails over the maniy of the man, it will be a female, by Allah’s leave.” The Jew said: You have spoken the truth; you are indeed a Prophet. Then he left and went away. The Messenger of Allah (blessings and peace of Allah be upon him) said: “This man asked me what he asked me, and I had no knowledge of any of that until Allah granted it to me.”
Modern science today tells us that the sperm and the egg together determine the genetic characteristics of the foetus, and whether the woman’s water comes first or not has nothing at all to do with determining the gender of the foetus, whether male or female. As you can see, the hadith is contrary to this scientific fact. If Muhammad was a Prophet and only spoke on the basis of inspiration from Allah, then how could he not know this fact; rather he said something contrary to science?!
I do not know, perhaps there is another explanation for this hadith of which I am not aware. If that is so, then I hope that you can explain it as much as possible. I hope that you will not regard my question as being by way of provocation or criticism.
Praise be to Allah.Firstly:
Some authors who wrote about the issue of what determines the sex of the foetus got confused when examining some hadiths that speak of the foetus. They looked at the hadiths that speak in a broad sense of which parent the foetus will most resemble, and interpreted them as referring to what determines the sex of the foetus. But that is not how it is; determination of the gender is different from the issue of resemblance to one parent or another.
Secondly:
Most contemporary scientists and doctors are of the view that it is the man who is responsible for determining the gender of the baby – by Allah’s leave – and the woman is simply like cultivated ground that has no say in what is planted; it is simply the place where it grows, by Allah’s leave. This is referred to in some verses of the Holy Qur’an.
Dr. Muhammad ‘Ali al-Baarr (may Allah bless him) said: It is scientifically proven that the gender of the baby is decided from the moment when the sperm meets the egg and fertilises it. If the sperm which carries the male chromosome Y meets the egg, then the foetus will be male, by Allah’s leave. But if the sperm that fertilises the egg carries the female chromosome, then the foetus will be female, by Allah’s leave. So it is the sperm or the man’s semen that determines the gender, whether the foetus will be male or female. “And that He creates the two mates - the male and female -From a sperm-drop when it is emitted” [an-Najm 53:45, 46]. The drop of semen that is emitted is undoubtedly the semen of the man. Allah, may He be exalted, also says (interpretation of the meaning):
“Does man think that he will be left neglected [without being punished or rewarded for the obligatory duties enjoined by his Lord (Allah) on him]?
Was he not a Nutfah  of semen emitted (poured forth)?
Then he became an 'Alaqa (a clot); then (Allah) shaped and fashioned (him) in due proportion.
And made him in two sexes, male and female.
Is not He (Allah Who does that), Able to give life to the dead? (Yes, He is Able to do all things)?”
[al-Qiyaamah 75:36-40].
End quote from Khalq al-Insaan bayna at-Tibb wa’l-Qur’an (p. 297, 298).
Thirdly:
If we decide that the correct answer concerning this issue is what we have mentioned above, then how can we reconcile between the above and the hadith quoted in the question, in which it is indicated that the woman has a role in determining the sex of the foetus? In answer to that, we say: there are three views concerning the issue of what determines the gender. These views are as follows:
-1-
Some scholars are of the view that there is no natural cause that determines whether the foetus will be male or female, and what is mentioned in the hadith of Thawbaan (may Allah be pleased with him), in which there is a reference to the determination of the gender of the foetus, is a mistake on the part of one of the narrators, and that the hadith is in fact speaking of the foetus resembling one or other parent, and is not speaking about the determination of it sex and whether it will be male or female. Among the scholars who held this view are Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him), and Shaykh al-‘Uthaymeen (may Allah have mercy on him), among contemporary scholars.
Ibn al-Qayyim (may Allah have mercy on him) said: The Prophet (blessings and peace of Allah be upon him) was asked how come the baby sometimes resembles the father and sometimes resembles the mother, and he said: “If the water of the man precedes the water of the woman, the child will resemble him, and if the water of the woman precedes the water of the man, the child will resemble her.” Agreed upon. With regard to the report narrated by Muslim in his Saheeh, according to which the Prophet (blessings and peace of Allah be upon him) said: “If the water of the man prevails over the water of the woman, the child will be male, by Allah’s leave, and if the water of the woman prevails over the water of the man, the child will be female, by Allah’s leave,” our shaykh – namely Ibn Taymiyah – had reservations about this wording and doubted whether it was part of the hadith. He said: What is soundly narrated is the first version, and determination of gender, male or female, has no natural cause; rather it happens by the command of the Lord, may He be blessed and exalted, to the angel, telling him to shape the foetus as He wills. Hence it is included with provision, lifespan and whether the individual will be blessed or doomed.
End quote from I‘laam al-Muwaqqi‘een (4/269).
-2-
The majority of scholars are of the view that the hadith is sound and that there is no confusion about the idea that if the woman’s water prevails, it will play a role in the baby being female, if Allah so wills. There was a difference of opinion concerning what is meant by prevailing – does it mean preceding or prevailing in a real sense, or prevailing in quantity and strength? The fact is that when the woman’s water prevails, it will have an impact on the selection of the sperm that carries the Y chromosome, which will result in a male child, or that which carries the X chromosome, which will lead to a female child – without that having a major role. So the matter goes back to the view that the main influence is the man’s water; the woman plays a minor role here, as her body prepares the environment to receive the sperm. An acidic environment kills the sperm that carries the Y chromosome whilst leaving the sperm that carries the X chromosome, thus the baby will be female, X X.
Dr Muhammad ‘Ali al-Baarr (may Allah bless him) said: The hadith – namely the hadith of Thawbaan – includes a description of the water of the man and the water of the woman. It also mentions the issue of maleness and femaleness, and indicates that it is determined by whichever of the two prevails. Therefore its becoming male or female depends on that.
This seems to be contrary to the verses which refer to the gender of the foetus, and state that it is determined by the man’s semen only – which is mentioned in the verses in Soorat an-Najm and the verses in Soorat al-Qiyaamah. It also seems to be contrary to medical information, which indicates that the sex of the foetus is only determined by the sperm that will fertilise the egg. If the sperm carries the Y chromosome, then the foetus will be male, by Allah’s leave; if the sperm carries the X chromosome, the foetus will be female, by Allah’s leave.
In fact there is no contradiction. Probably the issue of which water prevails – the man’s or the woman’s – may have an impact with regard to the selection of which sperm will succeed in fertilising the egg, by Allah’s leave. We know that vaginal secretions are acidic and can kill sperm, and that cervical secretions are alkaline, but they are viscous at times other than the time when the egg is released (ovulation), at which time they become less viscous. But up until now, we do not know the extent of the impact that the woman’s water has on the activity of the sperm that determine maleness or femaleness. It is essential to carry out careful research to determine the extent of the impact that these secretions have on the sperm that determine maleness or femaleness, and whether or not they have an impact on the activity of these sperm. There are those who say that what is meant by prevailing here is dominance; if the sperm that determine maleness dominate, then the foetus will be male, and if the sperm that determine femaleness dominate, then the foetus will be female, by Allah’s leave.
End quote from Khalq al-Insaan bayna at-Tibb wa’l-Qur’an (p. 390, 391)
-3-
The third view appeared recently, and says that the role of determining the sex of the foetus is shared by the man and the woman. The one who developed this view and is propagating it among people – as far as we know – is Dr Jamal Hamdaan Hassaanayn, a specialist in anatomy and embryology. With regard to the explanation of the hadith of Thawbaan (may Allah be pleased with him), he said: The kind of sperm that fertilises the egg depends on the electrical characteristics of these germ cells. When the egg has a negative charge, it attracts the sperm carrying the Y chromosome which always has a positive charge, and that leads to a male child. As the sperm that carries this chromosome and has a positive charge is higher according to the laws of nature, then the semen of the man will become dominant, and thus the prevalence of the man’s semen will lead to producing a male child. This is astonishingly in accordance with what the prophetic hadith says: “If they meet and the maniy of the man prevails over the maniy of the woman, it will be a male, by Allah's leave.”
But if the egg has a positive charge, then it will attract the sperm carrying the X chromosome, which has a negative charge, and will lead to producing a female child. This is also mentioned in the prophetic hadith: “If the maniy of the woman prevails over the maniy of the man, it will be a female, by Allah’s leave.”
Therefore, both man and woman play a shared role in determining the sex of the child. End quote.
The most likely of these views to be correct is the second view, which says that it is the man’s water that is responsible for determining the sex of the foetus, and in the case where the woman’s water prevails, which leads to the baby being female, that does not undermine the fact that the main role in this regard is played by the man’s water, and the woman’s water is not given an equal role. Yet we acknowledge that there is a need for modern, scientific study by more than one scientist and specialist in order to examine this issue from all aspects and reach a scientific conclusion on which there is consensus.
And Allah knows best.