Also check -
So while we may never know with absolute certainty why some fish began their evolutionary journey onto land, we do know through the collection of evidence that not only did such evolution occur, but that the organic structure for lungs were present in their rudimentary form even before the evolution of any land-based species began.
In addition, we know that in order to give up the water, new adaptations and random mutations also had to occur to lift the creatures off their bellies to protect their lungs. These changes lead to a dramatic explosion of animalia around the Earth and would eventually give rise to not only the dinosaurs, but eventually to small shrew-like mammals and of course eventually to the primates and to us.
As all of these changes are chance and accidental, or found through random mutation, or gene flow and speciation. In each case the mechanics of natural selection are clear. Not only do these processes deserve our respect (if not our admiration), but knowing the story of our natural antecedence is such a better and more fantastic story than can be found in any supernatural account of our creation.
Which came first, the gill or the lung?
Since fish appear in the fossil record earlier than the clade we call tetrapods does, it’s tempting to assume that modern fishes bear the same traits that their and our common ancestor did. This line of reasoning is intuitive, but it is not correct. Though it is true that both modern ray- finned fishes and the ancestor we tetrapods have in common with them are finned and aquatic, the same pattern of reasoning does not hold water when it comes to lungs.
The available evidence suggests that gills were present in the very earliest fishes, the common ancestor of hagfish and ray-finned fishes. However, lungs, gas-filled organs that serve the function of respiration, also evolved very early on. The common ancestor of the lobe- and ray-finned fishes had lungs as well as gills. So what happened to these lungs and gills? In the lobefins, lungs stuck around, and tetrapods, coelacanths, and (duh) lungfish, all inherited them and use them to obtain oxygen. Coelacanths and lungfish also retained their gills. Modern tetrapods, on the other hand, bear evidence indicating that we once had gills but that these were lost in the course of our early evolution. The ray-finned fishes retained gills, and some of them (e.g., the bichirs, BYK-heerz) also retained lungs for the long haul. But in the lineage that wound up spawning most ray-fins (and in at least one other lineage), lungs evolved into the swimbladder, a gas-filled organ that helps the fish control its buoyancy.