All life began in the seas. In the air, electricity and searing heat converted air molecules into sugar, lipids, proteins, and amino acids. These chemicals fell into the oceans and the super-heated oceans melted the chemicals together. The first macromolecules (lipids, nucleic acids, proteins, and carbohydrates) were fused together and captured inside "bubbles" with a phospholid outer covering. These "bubbles" were first around at 4 billion years ago, but they didn't become actual prokaryotes until 3.8 billion years ago. These ancestral prokaryotes became Archaeomonerans, bacteria, and in 1 billion years ago multi-cellular eukaryotes.
The Paleozoic Era
The invertebrates of the ocean took all types of shapes in an event called the Cambrian Explosion. Worms, snails, starfish, trilobites, and many other kinds of sea animals evolved. Sea scorpions and giant Orthocones ruled the seas in the Ordovician. Lampreys, small jawless fish-like animals, were the first fish in the oceans and the first animals with a notochord (a type of spine). Fish did not have jaws until the Silurian and by the Devonian they had evolved into huge forms like Dunkleosteus. Sharks, like Stethacanthus, also appeared about 420 million years ago.
The Mesozoic Era
During the Triassic, some reptiles took to the water. A group of animals called the Nothosaurs became some of the primary predators of the ocean. Nothosaurus and Cymbospondylus were some of the largest hunters in the ocean until the Ichthyosaurs and Plesiosaurs came along in the Jurassic. The sea reptiles diversified during the Triassic and some became strange-looking. Tanystropheus looks a lot like a small Sauropod, but it was only distantly related to dinosaurs. By the Jurassic, the Nothosaurs had disappeared and been replaced by the Ichthyosaurs and Plesiosaurs. Sea reptiles and fish took on massive sizes. Leedsichthys was an 80 ft filter-feeder fish from the waters around Europe. Since there were large herbivores and filter-feeders in the ocean, there would also be large carnivores. Liopleurodon had evolved to hunt these massive fish. Even some crocodiles spent all their time in the water instead of on land (like Metriorhynchus). By the Cretaceous period, a new group of sea reptiles called Mosasaurs had evolved. Mosasaurs looked a lot like crocodiles with fins, but these were far from crocodiles. Mosasaurus and Halisaurus were just a few of the many sea killers that lived in North America. Some giant fish even became carnivorous, like Xiphactinus. Some sea turtles took on large sizes too. Archelon may have been very large, but it was still preyed upon by Mosasaurs and carnivorous fish. The Plesiosaurs from the Jurassic had taken on large sizes, like Elasmosaurus. After the K-T Event, the giant killer sea reptiles were wiped out along with the dinosaurs.
The Cenozoic Era
With the rise of so many carnivorous land mammals, it's not a wonder that some mammals moved into the water. Ambulocetus and Pakicetus changed their lifestyle to ambush predators and became more like crocodiles. By about 36 million years ago, the massive carnivorous whale Basilosaurus had taken over the ocean. When Megalodon came along 28 million years ago, it became the largest shark in existence at 50 ft long. It hunted the small whales and seals like Odobenocetops. Megalodon died out 1.5 million years ago and the whales became the largest animals in the ocean. Today, the Blue Whale (Balaenoptera musculus) is the largest mammal in the world.