It’s a genetic arms race and the score is kept by who has the most grandchildren.
Every child has a female parent and a male parent, each of whom contribute half the child’s genes.
Let’s say a species of elephants has a genetic propensity towards female births. We’ll use nine females to one male as a hypothetical ratio and say there are a million elephants in each generation - 900,000 females and 100,000 males. And we’ll assume the total population stays at a constant size.
So you have a million elephants in the next generation as well. Now do the math. On average, every male in the previous generation passed his genes on to ten offspring while every female passed her genes on to 1.1 offspring. So male offspring are significantly better at passing genes on to future generations.
But genetics aren’t stable. New genes get introduced by mutation. A new gene M arises that produces more male offspring - elephants with the M gene have 90% male offspring and 10% female offspring.
This is a huge advantage. Male offspring already produce more heirs and now elephants with the M gene produced more male offspring. The first elephant with the M gene will have ten offspring - nine males and one female. Those ten offspring will have ninety-one offspring of their own - eighty-two males and nine females. Those ninety-one offspring will have 830 offspring - 747 males and 83 females. Those 830 offspring will have 7562 offspring - 6806 males and 756 females. And so on. As you can see the M gene explodes into the population.
But it doesn’t have its effect in isolation. The old ratio of 900,000 female births to 100,000 male births is no longer accurate. In just four generations, the M gene has shifted the ratio to 893,950 female births to 106,050 male births.
Now project this trend ahead a few hundred generations. Eventually you’re going to have a population where all the elephants have the M gene and that means future generations of elephants will be 100,000 females and 900,000 males. So it’s now female offspring that have an advantage in passing on genes. The average female elephant will pass her genes on to ten offspring while the average male only passes his genes on to 1.1 offspring. The M gene is no longer an advantage.
Now if we hypothesize a new mutation - an F gene that causes elephants to once again have ten female offspring to every one male offspring, we could watch the whole trend work in reverse. But you can see that neither gene gives a permanent advantage. The only stable long-term situation is where males and females are equal in number and have an equal chance of passing on their genes. No gene can have a long-term advantage based on it being held by the minority because the success of the gene will turn its possessors into the majority.