Chromosomes and abnormalities.
Biopsychologists believe that Gender and Sex are the same thing but this has been criticised by other theories.
The average human has 23 pairs of chromosomes.
Men have XY chromosomes and Women have XX.
Abnormalities occur when there are damaged, missing or too many chromosomes present and these abnormalities effect gender development.
For example, if a man has the pattern XXY in his chromosomes he will develop Klinefelters syndrome in which men have male sexual organs but also develop breast tissue, smaller testes and a female pattern of pubic hair. (47 chromosomes)
Whereas if women are missing an X chromosome as it has been damaged or just isn't there, they could get Turners syndrome in which they develop a webbed neck, heart problems and are shorter than the average human. (45 chromosomes)