Why did Darth Vader die?

Because if you remember, he threw the Emperor over the edge of a railing and into a power core. But the Emperor was releasing Sith lightning during this and the lightning malfunctioned Darth Vader's suit and the suit was the only thing that was keeping him alive.