ProfessorDent I'm out of touch with what causes Ecstacy deaths these days, but in the 90s, when people died after taking pills, it usually became apparent that the pill wasn't actually ecstacy. There was a lot of MDEA going around at one point being sold as Es, I remember, for example. It was similar in effect to MDMA, but more "rushy". It was easier to overdose on IIRC.
Someone I know died after taking a "snowball". It took her days to die and it's possible she could have been saved if she wasn't wasn't put off going to hospital because of the illegality of what she'd taken. I don't remember what was in it, but I do remember people knowing that it wasn't MDMA at the time. I remember the DJ turning the music off once, to warn people off buying them. Something I've never seen before or since. (Probably because people got used to Es being anything but MDMA, not because quality overall improved).
One of the ways people die from actual MDMA, I believe, is overheating. This is has a lot to do with the environment in which pills are taken. Many people like to take MDMA and dance for hours. When this is in hot sweaty environments, sometimes without drinking properly, this could be dangerous. In the 90s, many mainstream clubs refuse to serve free tap water and even turned off the water in the toilets, despite knowing it was putting lives at risk, as they were missing out on revenue from alcohol, and cared more about profit than their punters' lives.
The risk of overheating can be mitigated by taking regular breaks, drinking water and taking it seriously if the environment you are in is too hot.
Tragically, Leah Betts, who became infamous posthoumously when she died after taking ecstacy (I don't know if it was pure or not) actually died because she drank too much water, it wasn't actually the drug which killed her. She must have heard that drinking water was the right thing to do, but she drank so much she overloaded her body. Very sad 
Otherwise MDMA is a stimulant, so obvious risks from people with existing heart conditions etc, and it is possible to overdose I expect, although I think you would have to take a fair amount.
This is all off the top of my head, so if you want a proper answer it might need a bit of as google.
Overall though, statistically speaking, the risk of death is pretty low.