Through their gills,the majority of fish absorb oxygen from the water. However , an odd thing happened once terrestrial plants appeared: some species of fish envolved lungs to breathe air. They are known as lungfish , and scientist believes that the lack of oxygen in the shallow lakes and rivers where they resided is what led to their evolution.