Whatever He wills happens, and whatever He does not will does not happen
To Allah belongs the dominion of the heavens and the earth; He creates what He wills. He gives to whom He wills fenale [children], and gives to whom He wills males.
Whatever He wills happens, and whatever He does not will does not happen. He gives to whomsoever He wills and withholds from whomsoever he wills; none can withhold what He gives, and none can give what He withholds, and He creates whatever He wills.
He bestows female upon whom He wills
He gives them daughters only. Al-Baghawi said, "And among them (those who were given daughters only) was Lut, peace be upon him."
and bestows male upon whom He wills
means, He gives them sons only. Al-Baghawi said, "Like Ibrahim Al-Khalil, peace be upon him, who did not have any daughters."
﴾أَوْ يُزَوِّجُهُمْ ذُكْرَاناً وَإِنَـثاً﴿
Or Hr bestows both males and females
means, He gives to whomsoever He wills both males and females, sons and daughters. Al-Baghawi said, "Like Muhammad ."
and He renders barren who He wills
means, so that he has no children at all. Al-Baghawi said, "Like Yahya and `Isa, peace be upon them." So people are divided into four categories: some are given daughters, some are given sons, some are given both sons and daughters, and some are not given either sons or daughters, but they are rendered barren, with no offspring.
Verily, He is the All-Knower
means, He knows who deserves to be in which of these categories.
and is Able (to do all things)
means, to do whatever He wills and to differentiate between people in this manner.
This similar issue is referred in Surat Maryam, ayat 21 where Allah says to Isa, peace be upon him:
And (We wish) to appoint him as a sign to mankind
This is the Answer Jibril relayed to Maryam when Maryam was relayed that she will have a pure boy
Jibril said, "I am only the messenger of your Lord to give you (news of) a pure boy [i.e. son]
And (We wish) to appoint him as a sign to manking
i.e., proof for them of His power, for He created people in four different ways. Adam, peace be upon him, was created from clay, from neither a male nor a female. Hawwa, peace be upon her, was created from a male without a female. All other people, besides `Isa, peace be upon him, were created from male and female, and this sign of Allah was completed with the creation of `Isa bin Maryam, may peace be upon them both, who was created from a female without a male
Allah then says:
This issue has to do with parents, whilst th eprevious issue has to do with children, and in each case there are four categories.