Just like the lungs of humans, the gills of fishes are the sites where oxygen is absorbed and carbon dioxide is removed. In addition, the gills are responsible to a varying degree for regulation of the levels of various ions and the pH of the blood.
The gill filaments of bony fishes (also known as a primary lamellae) are complex structures which have a large surface area. Off each are numerous smaller secondary lamellae. Tiny blood capillaries flow through the secondary lamellae of each gill filament. The direction of blood flow is opposite to that of water flow. This ensures that as the blood flows along each secondary lamella, the water flowing beside it always has a higher oxygen concentration than that in the blood. In this way oxygen is taken up along the entire length of the secondary lamellae.
Active swimming fishes, such as the Blue Mackerel have well developed gill filaments to maximise the amount of oxygen that can be absorbed. Less active, bottom-dwelling fishes generally have much smaller gill filament volumes.
Not all fishes rely totally on their gills to breathe. Some species, especially when they are young, absorb a large proportion of their oxygen requirements through the skin. Others species have well developed lungs for breathing air, and will in fact drown if they do not have access to the surface.