Whales are related back to a hairy, 4-legged land mammal that eventually led to the formation of flippers without phalanges, a blow hole that became more dorsal, and other defining features. All of this has been backed by fossil evidence, especially that found within a certain desert region (can’t remember the name) that has a vast amount of whale fossils from many different time periods