Although our chromosomal pairing will determine our sex (XX '' female and XY '' male), this does not necessarily determine one’s gender.
Gender is influenced at a pre-natal stage, via the release of testosterone from the gonads of an XY foetus. It is this testosterone release that sets in motion the train of events that lead to the eventual release of the other androgens from the pituitary gland. It is the lack of testes, and therefore the lack of testosterone, that influences an XX foetus to develop into a female.
Even before these events take place, the undeveloped gonads in the XX or XY foetus (Mullerian and Wolffian respectively) are instructed to develop into testes or ovaries (again, respectively) due to the presence or absence (in the case of the XX female) of a gene called SRY on the Y chromosome.
Although both of these processes are designed to produce not only a male or female sex but also a male or female gender, they do not always succeed in doing so.
A rare condition called AIS (Androgen Insensitivity Syndrome) is seen in some people. This insensitivity of their developing bodies to the androgens in their bodies (being XY individuals), means that they have male chromosomes, but appear female. Most AIS sufferers will live relatively full lives with a female gender, although they are not able to have children.
Conversely, there are also some XX individuals who, due to excessive exposure to male hormones whilst developing, have a condition called Androgenital Syndrome, which gives them the appearance of being a male, including having what looks like male genitalia.
In the case of both AIS and Androgenital Syndrome, we see that chromosomes have not managed to determine gender.
Some people are born one sex, but believe themselves to be in the “wrong” body. In this case, men have transgender operations to be able to adopt a female lifestyle and