Early fossils from fifty millions years ago suggest that they colonised the shallow seas to feed on abundant food. In order to successfully colonise the sea, a number of important changes had to be made. The eyes had to become more elongated. Human eyes cannot focus underwater because the eyeball is too short and images underwater would focus behind the retina. The kidneys had to adapt to handle sea water.
Humans die if they drink sea water for more than a couple of days.
Cetaceans had to develop a kidney that could handle the high salt level in sea water. The nostrils had to migrate to the top of the body. Bear in mind that our nostrils are face down in water. Somehow, the opening to the breathing holes had to move. Whales and Seals had to develop physiological changes in order to dive deep.