We think life on Earth originally evolved in the ocean. When larger animals, like fish, evolved, they had to be able to absorb oxygen directly from water. Some of the descendants of these early fish gained the ability to breathe air and became the ancestors of reptiles, birds, and mammals.
Fish continued to evolve as water-dwelling organisms. Since they can’t breathe oxygen from air, they need to stay in the water to survive.
All modern day animals share some ancestor, The difference between fish and land-living animals is that our ancestors grew legs, at some point in the Devonian period (around 360 million years ago) and developed from then on, according to the challenges the new habitat offered them. Fish however represent the remainder of the older lineage (which possibly began with primitive eels-like animals) that started around 530 million years ago. They did not develop the capability to move onto land (except for a few fish like mudskippers).
A common misunderstanding about evolution that I’ve noticed over this last couple of weeks is that people seem to think that humans are the ultimate pinnacle in evolution and everything else is just under-evolved. That’s not really the case, certainly we are one of the most successful species on the planet but success depends upon the environment. Fish are highly adapted to living in the oceans and are always evolving. Fish adaptations to an aquatic lifestyle include very efficient gills, a very successful spawning strategy and ultra-efficient muscles and streamlining. That a marlin can swim faster in the ocean than a cheetah can run on land shows you that fish are well-evolved.
It might help to think about evolution in this way: Animals are always evolving to fill ‘ecological niches’ (i.e. take best advantage of a particular resource or space) – If all the fish evolved into terrestrial animals, there’d be no fish left to occupy the sea and make use of the bounty it offers. In fact the sea is so inviting that a whole order of mammals (Cetacea: Whales and Dolphins) went back to sea having lived on land for a while