If you look at the biology of how sexual development occurs, both intersex and transgender have the same underlying cause: abnormal hormone levels during part (or all) of your prenatal development (or, with AIS, normal hormone levels but an inability to respond to those hormones).
There's this deeply ingrained belief amongst the general populace (and even most doctors it seems), that your sex is determined by whether you have a Y chromosome or not. However, that's not how it actually works at all. All the Y chromosome does is, during a critical window from about 6 to 8 weeks after conception, cause your undifferentiated gonads to turn into testicles. Once your testicles form, they promptly start churning out testosterone, and the testosterone (and DHT, a hormone that's made from testosterone) causes you to develop as male. It's the testicular hormones that cause you to develop as male though and not the Y chromosome, and without those hormones (or, in AIS, if the body can't respond to male hormones), then you develop as female instead. This is demonstrated very well by the condition Complete Androgen Insensitivity Syndrome, in which genetically male people develop as female.
A similar thing happens in Swyer's syndrome, in which the testicles fail to develop for whatever reason, in otherwise genetically male people:
In both cases, the male hormones testosterone and DHT completely fail to act throughout prenatal development. The result is you end up with a person who is infertile, but otherwise to all intents and purposes a woman, despite having a Y chromosome and being genetically male. This shows that the sex you develop as is entirely determined by what hormones are present during the time your prenatal development is taking place, not by whether you have a Y chromosome or not.
If anything happens to disrupt your hormone production during that critical time, it's easy to end up in a situation where some of your development has occurred as male and some as female, and that's how both intersex and transgender can arise. With intersex, the hormone disruption has occurred during the first trimester (which is the critical time for genital development), whereas with transgender, it's occurred during the second and/or third trimester (by which time genital development has finished, and the main thing still ongoing is brain development). There's a fair bit of overlap between the two though. For instance, most of the XXY people I've chatted to are quite genderfluid, and Caroline Cossey is one well known example of an (XXXY in her case) intersex person who's also transgender. A lot of transgender people who were exposed to DES also have intersex-related genital abnormalities, so there's definitely an overlap between the two in that situation as well. There's also plenty of animal research showing that exposure to external hormones early in prenatal development affects genital development, whereas later in the pregnancy it causes cross-sexed brain development.
I think probably the main reason why there's so much mystique about the whole thing, is because doctors and the pharma industry don't want to admit that most of us have ended up the way we are through their reckless use of hormones in pregnant woman!