Why Dead Whales are so Dangerous

Whales are the most likely animal to beach themselves and do so more frequently than one might expect. Why this happens is, however, not completely resolved. Whats more, whales have a tendency to explode after they die, which might endanger any clueless bystander that came to inspect the carcass. But why do they do that, exactly?