Ordinary human body cells contain 23 pairs of chromosomes. Twenty-two of these pairs control characteristics only. The remaining pair carries the genes that determine sex, so these are the sex chromosomes.
In females the two sex chromosomes are the same, XX. In males they are different, XY. When gametes form, the chromosome pairs separate. Every egg cell carries an X chromosome. Half of the sperm cells carry an X chromosome and half carry a Y chromosome.
A genetic cross shows this. Mother XX and father XY give offspring XX, XX, XY and XY. The ratio of female to male is 1 : 1, so the probability of any one baby being female is 50%, and the same for male. If a sperm carrying a Y chromosome fertilises the egg, the baby is male. If a sperm carrying an X chromosome fertilises it, the baby is female. Each pregnancy is independent, so earlier children do not change the chances.