Before modern science, you needed a man and a woman to make a baby. Maybe it is for monogamous societies or would apply also to polygamy but there should be just a common average of the number of child a father will procreate. Especially taking care of the fact that he needs to be able to take care of them.
Removing outliers, must men will not do more than 1 to 4 kids for example.
So somehow if you have a too high ratio of women, birthrate will decrease, and same too many men not enough mother do birthrate would decrease also.
So there should be a natural regulation at big scale to keep the population stable or growing.
And probably, the individuals contributing to birth with the good ratio would be the one reproducing themselves so helping correcting anomalies in the long run.
There are probably also environnemental and genetic factors that are at play to determine baby gender, not only perfect randomness, that are still unknown to us.
I think a lot of people are wondering, if I have 2 kids, 2 boys, what are the odds to have a girl the third time? Is it really 1/2 or in a more cases it will be a boy again?
If anything, infanticide is likely the cause of distortion. Look at China's One Child Policy.