Its to do with the environment you make for the sperm to survive in. Different genders are slightly different shaped and can move through different cervical mucus easier, and do better in different PH of mucus. Also its noted that in certain times there are higher numbers of certain genders born, like girl babies would naturally stronger than boys and have a better chance of survival, so you tick your body into thinking times are hard and food is scarce to produce a girl (low everything diet and 60 minutes cardio a day) or you make it think times are good and boy babies would do well now (high everything diet and moderate exercise)
Thats just the tip of the ice burg, all the info is overwhelming at times.
And of course it isn't one 100% because it is ultimately down to which ever sperm gets there first. But you can help even out your odds. Of course if you just keep going on and on having babies you will eventually get the opposite. Or you could get lucky and get it next time because the odds are in our favour with out doing anything.
Who knows perhaps it is just that persons time to get that gender. I'm pretty sure I'll get a boy no matter what I do, but I'm not taking any chances either, so if I can improve the chance of a girl even slightly, at this point with it being my last shot, then I'm going to give it a go.