How does Google Analytics know the sex, age, interests of visitors?
Google can determine user's gender and age when an user provide his name to a google account or to a google partner. Having an user name is easy to discover the gender using a service like Dots Name Validation (http://www.serviceobjects.com/products/demographics-more/name-validation).
Also many visitors uses a google account where their provide informations like gender and date of birth.
As you may see, the information is not 100% accurate. It's just a small estimative.
They don't.. I manage an Arabic baby web site where 90% of the users are supposedly male.. hmm? So male Arabs are looking at a baby website???! NO they probably have wives who log on using their accounts.. It's a meaningless statisitic