In a recent study it was found that mums can adjust the sex of their unborn baby to match the quality of their living conditions.
Genetics are a factor, but it's believed that mothers exert far more control than dads do.
Stress hormones circulating in the mother may help to drive the process.
"It seems likely that when there are large and predictable costs associated with producing and/or rearing either sons or daughters in a given environment, females should bias offspring sex ratios to produce the sex that will perform best in the given environment," co-author Sarah Pryke told Discovery News.
"Altering offspring sex ratios in response to the quality of the local environment is likely to be highly advantageous to any species, as it should allow mothers to best match the phenotype of their offspring to the prevailing condition, and thus maximize their own fitness," Pryke, a researcher in Australian National University's Research School of Biology, added.
Prior studies on birds, reptiles and mammals-including humans-has long suggested that this was the case, but scientists were unclear on what factors triggered the son or daughter outcome.
Some researchers, for example, speculated that the overall body condition and health of the mother affected the outcome of her child's sex.
To help eliminate that possibility, Pryke and colleague Lee Rollins studied a bird, the blue-faced parrot finch, whose body condition appears largely insensitive to changes in nutritional quality.
The researchers randomly assigned 56 of the female birds either a high-quality or low-quality diet.
The former contained 20 percent protein, with egg, wheat germ, a seed mixture and more, while the latter contained only 8 percent protein.
After 12 weeks on the diet, the birds were weighed and underwent blood tests to measure various aspects of their health.
Based on these tests, all of the females were in comparably good and equivalent shape both before and after the 3-month study period.
Mother birds fed the lower quality diet, however, later produced far more sons than daughters.
"In this case, it is adaptive for mothers to produce more sons when conditions are poor because sons are much less vulnerable to nutritional stress than daughters," Pryke explained.
"For example, sons reared on poor quality diets grew faster, were healthier, fledged earlier and were much more likely to survive than daughters.
"Indeed, more than 51.5 percent of daughters reared on low quality diets died before reaching parental independence compared to only 7.3 percent of sons," she said.
It is unclear whether or not human moms would produce more sons or daughters when environmental conditions are poor.
That will probably remain a mystery for quite a while, since, as Pryke said, "researchers can't do experimental manipulations, like in the current study" on humans.
The sex of an individual is also at least partially determined by genes, giving dads some level of indirect control over the sex outcome of their progeny.
The study is published in the latest Proceedings of the Royal Society B.