Intuitively, I would expect that an organism that has lived in the ocean for millions of years and can breathe underwater should outcompete any newcomer that is not fully adapted for oceanic life. It makes sense that there may be some semiaquatic animals that can outcompete fish in semiaquatic niches, such as seals, crocodiles, and diving birds. And I could see there being short-term instances of odd species that manage to colonize an isolated area that happens to lack competition.
But dolphins and whales are extremely successful across the globe, have been around for millions of years, and a large part of their niche overlaps with the much older and also hugely successful sharks, yet they manage just fine. A common explanation of this is "intelligence" but sharks are now known to be pretty intelligent, and even if they weren't, why wouldn't they be?
This isn't the first time this has happened, either. Aquatic reptiles like ichthyosaurs, plesiosaurs, and mosasaurs, and even modern sea turtles, represent hugely prolific and long-lasting groups of air-breathing, fully-aquatic animals (sea turtles come on land to lay eggs, but this seems more like a flaw than an advantage), suggesting that there is something in particular about land-dwelling that gives animals returning to the sea a natural advantage not found in their piscine counterparts.
Is there anything specific about evolving on land - some particular trait that doesn't generally evolve in aquatic animals - that cetaceans retained after returning to the sea, and that makes them particularly successful in the aquatic lifestyle?