To Allah belongs the dominion of the heavens and the earth; He creates what he wills. He gives to whom He wills female [children], and He gives to whom He wills males. Or He pairs them with males and females, and He renders whom He wills barren. Indeed, He is Knowing and Powerful. [42:49-50]‌

Commenting on this in his book of tafsir, Imam Ismaa’eel ibn Kathir wrote the following:

Allah informs us that He is the Creator of the heavens and the earth, and the owner of them both, and the controller of what is in them. And He informs us that whatever He wills is, and whatever He does not will is not, and that He grants what He wills and prevents what He wills, and there is none who can prevent what He grants nor is there anyone who can grant what He prevents. And He informs us that He creates what He wills, and:

يَهَبُ لِمَن يَشَاءُ إِنَاثًا

He gives to whom He wills female [children]

– meaning, He provides one with only daughters . Al-Baghawi said, “Included in this category is Loot (‘alaihi al-salaam).”

وَيَهَبُ لِمَن يَشَاءُ الذُّكُورَ‌

and He gives to whom He wills males

– meaning, He provides one with only sons. Al-Baghawi said, “Such as Ibrahim al-Khaleel (‘alaihi al-salaam) – no females were born to him.

أَوْ يُزَوِّجُهُمْ ذُكْرَ‌انًا وَإِنَاثًا

Or He pairs them with males and females

– meaning, He grants whom He wills among mankind a pairing of male and female – meaning, from both this and that. Al-Baghawi said, “Such as Muhammad (ﷺ).”

وَيَجْعَلُ مَن يَشَاءُ عَقِيمًا

and He renders whom He wills barren

– meaning, none are born to them. Al-Baghawi said, “Such as Yahya and ‘Eesaa (‘alaihimaa al-salaam).”

So Allah made mankind into four categories; among them are those who are granted daughters, and among them are those granted sons, and among them are those granted both categories – male and female -, and among them are those who are prevented from both these and those. So He made this last group barren, with neither (existing) progeny nor anything being born to them.

إِنَّهُ عَلِيمٌ

Indeed, He is Knowing

– meaning, He is Knowing of who deserves each one of these categories.

قَدِيرٌ

and Powerful

– meaning, Powerful over everything thing, in contrast to mankind in that respect.

وَلِنَجْعَلَهُ آيَةً لِّلنَّاسِ

and We will make him a sign to the people [19:21]

– meaning, a proof to them of Allah’s power – Exalted and Sanctified is He – such that He created the creation according to four categories. For there was Adam (‘alaihi al-salaam) who was created from dust, neither from a male nor a female. And there was Hawwaa (‘alaihaa al-salaam) who was created from male without a female. And the rest of the created being other than ‘Eesaa (‘alaihi al-salaam) were created from [both] a male and a female. And ‘Eesaa (‘alaihi al-salaam) was created from a female without a male, so the proof was completed with the creation of ‘Eesaa ibn Maryam (‘alaihimaa al-salaam). It was for this reason that He said:

وَلِنَجْعَلَهُ آيَةً لِّلنَّاسِ

and We will make him a sign to the people [19:21]

So this case here is in regards to parentage, while the first case above is in regards to offspring – and both of them are divided into four categories – Exalted is Allah, the All-Knowing, All-Powerful.

[Tafsir ibn Kathir 7/217]

Translator’s Note: Imam Muhammad al-Shawkaani mentions an interesting linguistic point in his tafsir of this passage by writing:

It is said, “the fact that the word ‘males’ is mentioned with the definite article of alif and laam indicates their honor over females”, though it could be said, “indeed the giving of precedence [in order] to females opposes that”, so there is no proof in this ayah for the differing merit – rather, that is being used here for a different purpose.