A pure pill can easily kill, just like any drug that is given even legal ones. The drugs we are prescribed only have a tiny amount of the active ingredient.
I take blood thinners aka rat poison, if I bought a street version it would have a unknown mg of warfarin and most likely kill me as any amount over prescribed can be deadly. The tolerance is quite small between therapeutic and death.
The party drugs are much less lethal than this, but a excessively large dose either too many pills or high a purity or nasty shite it is blended with can be fatal. That is why testing is so important and the willingness of friends to seek medical attention ASAP. Many do not from fear of police trouble and hope for the best. Many die when seeking help would have meant a minor hospital stay.
If we had a legal regulated supply then deaths would be extremely rare and people would choose safer drugs than things like ICE, which people take as it is cheap and easily available. Also keep in mind a lot of dance party deaths are actually not directly from the drug but from excessive alcohol as they just keep drinking or hyperthermia as the keep dancing and overheat. Others are from excessive drinking of water. Yes too much can kill, and has many times, the blood dilutes and the brain actually drowns. This was the case of a famous drug death years ago, it was her drinking 6 litres of water in approx a hour- her body could not process that much in such a short time.
It is the fact such drugs are illegal that leads to the vast harm, injury and deaths.