As far as I know REM is just brain running a simulation
During sleep hormones and neurotransmitters shift in their quantities available along the phases of sleep: slow wave sleep, intermediate stages and REM ( this happens several times during a typical sleeping session) and each phase brings corresponding highs and lows of the aforementioned chemicals.
There is not a definitive and agreed function of sleep, but currently it is heavily tied to memory consolidation and metabolic regulation as well as a supporting role in the immune system.1
When death from sleep derivation occurs, what mechanism is failing that makes one not to be alive anymore.
Well, we don't really know,at least in humans it is not something we can really experiment, so most of the accounts are just that, anecdotes.
In order to try to answer the question, we unfortunately have to turn to the animal world, studies of Total Sleep Deprivation (TSD) in rats are perhaps the best researched ones, and yet there is still coinsiderable doubt about what ends up being the cause of death. 2 and it's relationship to sleep.
I mean there has to be some physical thing that breaks down
To summarize a review/update of the original sleep deprivation study3 :
The effects of total sleep deprivation seem to have interfered with thermoregulation,caused a deterioration in the appearance of the rats, skin lesions, and changes in brain activity; infection, hypothermia and malnutrition are the leading suspects then and the thing that broke down in a roundabout way is the supporting mix of chemicals ( neurotransmitters, hormones) & brain activity that normally keep these deadly effects at bay.
Reference/Sources: