It would be hard, looking at whales and elephants, to see how they could exist in any but the most ancient and distant of branches together, but the history of their divergence is actually much more recent than it seems. Cetaceans (whales and dolphins), pachederms (wooly mammoths and elephants) and serenia (manatees, dugongs) are all part of a much larger subclass of mammals called ungulates.
The name ungulate literally means “toe walkers,” and refers to the species of life that the cooler, drier climates of the post-dinosaur world gave rise to. As grasslands and wide open spaces began appearing, some mammals began walking higher off the ground with their legs directly under them. This is as distinct from Dimetrodon and other mammal-like dinos whose legs were beside the animal.
The early era of ungulates is the era of the “mega-fauna.” These huge species of plains grazing animals included the Uintatherium, which was a species that looked like the modern rhinoceros, which roamed the plains of Wyoming 52 million years ago.
Eventually, some of these ungulate species grew thicker toe claws which eventually became hooves. Horses, goats and the other hooved animals descend from this line.
Still others never developed hooves, but retained the original digits. Of these, some evolved into the pachyderms like great wooly mammoths and elephants. Others returned to the sea and became seals, walruses, manatees and whales. In fact, close inspection of some species of whale’s fins reveals depressions where the old “toe walker” claws still remain.