It doesn't require a tally, it just requires that the body stores something that correlates with number and gender of previous children. Like, say, indefinitely retaining genetic material from each of them. Which, you know, mother's bodies do:
“Not only fetal cells, but also fragments of fetal DNA can be present in the maternal circulation indefinitely after pregnancy. This finding has practical implications for non-invasive prenatal diagnoses based on maternal blood, and may be considered for possible pathophysiological correlations.”
https://pubmed.ncbi.nlm.nih.gov/12107445/#:~:text=Not%20only....
I still think it's a bit unlikely that there's a meaningful connection to be had there, but I wouldn't be totally shocked if I were proven wrong.
From Wikipedia:
> The mechanism is thought to be a maternal immune response to male fetuses, whereby antibodies neutralize male Y-proteins thought to play a role in sexual differentiation during development.
The article states even interrupted pregnancies are thought to generate this response.
That said, it would be very interesting if the body did actually count and take measures to keep things even.
The reproductive system doesn't "want" anything any more than your immune system "wants" to fight viruses and invading pathogens.
Why couldn't a similar mechanism be at play here?