All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad (sallallaahu 'alayhi wa sallam) is His slave and Messenger.
The basic principle is that a woman is forbidden from requesting a divorce without a valid reason, and a severe warning has been reported regarding this. In Sunan Ibn Majah, on the authority of Thawban, he said: The Messenger of Allah (sallallaahu 'alayhi wa sallam) said: “Any woman who asks her husband for divorce without a valid cause, the fragrance of Paradise becomes forbidden for her.”
However, if the woman has a valid reason, then there is no harm in her requesting a divorce. Ibn Ḥajar (
) said in Fat'ḥ Al-Bari: “The reports that warn women against seeking divorce from their husbands are to be understood as applying when there is no cause that warrants it.” [End quote]
Al-Manawi (
) said in his commentary on Al-Jami’ Al-Ṣaghir: “Meaning: when there is no difficult circumstance that pushes her to do so.” [End quote]
Lastly, if the woman’s husband has something that prevents him from having children, then her request for divorce in this situation is permissible, because having children is one of the greatest purposes of marriage. In the book of questions posed to Imam Aḥmad Ibn Ḥanbal and Is'ḥaq Ibn Rahawayh, it is mentioned: I (Is'ḥaq bin Mansur Al-Kawsaj) asked: “A man marries a woman while he is sterile and unable to have children?” Imam Aḥmad (
) replied: “I prefer that if he knows this about himself, he should disclose it — perhaps his wife wants to have children.” [End quote]
Allah knows best.