It's the opposite, actually.
It is evolutionarily favorable to give birth to the sex that is less numerous at sexual maturity. If female babies started dying, for whatever reason, the chance the average baby is female would gradually increase until the ratio of sexually mature females to males balanced out.
Incidentally, this is presumably why there are slightly more males born than females [1] - males tend to die more frequently than females during childhood.
___
1. https://en.wikipedia.org/wiki/Human_sex_ratio
> In humans, the natural ratio between males and females at birth is slightly biased towards the male sex, being estimated to be about 1.05[2] or 1.06[3] males/per female born.
Perhaps I'm missing something, but how does the human body have internal knowledge of the current gender ratio in society such that it will attempt to fix the ratio to balance?
It doesn't.
This process happens strictly through natural selection.
If average female fertility is F, the number of sexually mature females is f and the number of sexually mature males is m, then the average male fertility is F * f / m (each child is conceived by exactly one male and one female). This means that the less numerous sex has a higher fertility.
It is not true that each child is equally likely to be male or female. Some parents are more predisposed to have male children and some parents are more predisposed to have female children. The parents predisposed to have more reproductively successful children will have their genes flourish - pushing the sex balance of new babies slightly in the corrective direction.
[1] By that I mean: Mutation are not "created" by the environment. Evolution theory shows that we "select" mutation which will then become present in the majority of the population over several generation (provided that the mutation can be passed to offspring and yield a significant benefit that will last over several generation).
Mutation happens all the time in your body, although, if i remember my high school biology class, most of them get "fixed". And mutation are only one of the many "tools" that help create diversity (chromosome recombination for example).
The above is numbers from one dairy farm I know of with ~3000 cows. I'm sure each farm is different.
I also wonder if in the future chicken farms will apply this when the technology get more refined, the patents expires and the cost of artificial insemination is cheaper than wasting time and resources on eggs only to then kill half the offsprings.
Outside of fiction - no.
Somewhere in the past our ancestors evolved a male counterpart to enable sexual reproduction.
Weren't there no "gender" nor "female" before sexual reproduction evolved ?