Why ancient deer returned to the sea and became whales

Over the last 250 million years land animals have repeatedly begun exploiting the seas, giving rise to creatures like whales and walruses. The question is why