In 1973, the biologist Robert Trivers and the computer scientist Dan Willard made a striking prediction about parents and their offspring. According to the principles of evolutionary theory, they argued, the male-to-female ratio of offspring should not be 50-50 (as chance would dictate), but rather should vary as a function of how good (or bad) the conditions are in which the parents find themselves.

Are the parents’ resources plentiful — or scarce? The Trivers-Willard hypothesis holds that when their conditions are good, parents will have more male offspring: Males with more resources are likely to gain access to more females, thereby increasing the frequency with which their genes (and thus their parents’ genes) are preserved in future generations. Conversely, male offspring that lack resources are likely to lose out to males that have more resources, so in bad conditions it pays for parents to “invest” more in daughters, which will have more opportunities to mate.

It follows, as a kind of corollary, that when parents have plentiful resources they will devote those resources more to their sons, whereas when resources are scarce, parents will devote them more to their daughters.

In short: If things are good, you have more boys, and give them more stuff. If things are bad, you have more girls, and give more of your stuff to them.