Sex determination, or whether someone has a boy or girl, is not a commonly understood phenomenon. Just ask anyone who has been pregnant after having a string of boys. It's hard to count the number of times that she will hear, "oh - this one must be a girl!" (trust me on this one.)
Why, exactly, must this one be a girl?
The sex of each baby is determined independently - and separately from the last - like a coin flip. If a coin is flipped "heads" four times in a row, the next flip does not have to be tails. Each coin flip is done independently of the last one. That means that each one has a 50/50 chance of going one way, even if the flip is done after a string of eight "heads." The chance of getting 8 heads in a row is low, but so is winning the lottery and some people end up instant millionaires.
The most basic understanding of whether a baby is born a boy or girl lies in the X and Y chromosome. Eggs have one copy of an X chromosome. Sperm have one copy of either the X or the Y. An egg with an X chromosome that combines with the sperm's X chromosome makes a baby girl (XX). A sperm's Y chromosome will combine with the egg's X chromosome to make a boy (XY). Whichever sperm swims the fastest, reaches and fertilizes the egg first, determining the sex of the fetus.
Because the world's sex ratio at birth is just slightly off of 50/50, (there are 105 males born for every 100 females), the X and Y sperm do this at almost exactly the same rate.
But, there are some families that are not even close to that ratio. They have all girls or all boys. And, although that could happen simply by chance, there may also be a reason for it.
Some studies suggest that there is more to the process than coin flipping. One study published in Evolutionary Biology looked at 927 family trees from hundreds of years back and found that the tendency to have girls or boys was inherited. They concluded that the father's genes may also be involved in the process.
Whether a sperm is carrying an X chromosome or a Y chromosome is still the critical factor. But, what if a father is genetically predisposed to making more sperm carrying an X chromosome? Then, he has a higher likelihood of having daughters. The same goes for a man who makes more sperm carrying a Y, having a higher chance of having sons. Or, what if the number of X and Y carrying sperm produced is the same, but the sperm carrying an Y are slower, therefore less likely to fertilize the egg?
Any genetic influence such as would not have any effect on the ratio of males to females as a whole. However, it could make a difference in the smaller context of one family. If you are the mother of 7 boys, and you keep trying to have a girl (or vice versa) it might be that the number of coin flips will not make a difference because you are not playing the game with a coin with two sides. If your husband does not make sperm that carry an X chromosome, a girl is not possible, and you are going to lose the coin toss every time.
Source: Gellatly et al. Trends in Population Sex Ratios May be Explained by Changes in the Frequencies of Polymorphic Alleles of a Sex Ratio Gene. Evolutionary Biology, Dec 11, 2008; DOI: 10.1007/s11692-008-9046-3