Intersex is a term for biologically/ physically not being strictly male or female sex. Having one of over 30 differences of sex development is the reason this can occur.
To clarify, intersex or differences of sex development refer to the biology and/ or appearance (phenotype) of an individual, where as gender (how a person identifies) and sexual orientation (who a person is attracted to) are different things.
With these differences, variations in the usual path of prenatal development of parts of the reproductive system cause traits that we don’t usually expect in typical boys and girls. There may be unexpected patterns of the X and Y chromosomes (karyotype), gonads (which make sperm and eggs- the testes and ovaries), internal reproductive and urinary organs (uterus, fallopian tubes, bladder and urethra), or different looking genitalia.
Potential causes include genetic mutations, changes in number of sex chromosomes, atypical gonads, exposure to unusual levels of sex hormones, or atypical response to hormones. Intersex traits or DSD are not life-threatening, although they may be associated with a serious medical condition such as salt-wasting congenital adrenal hyperplasia (SW CAH).