How do fish breathe underwater?
Through gills, which extract dissolved oxygen from water. The engineering is more impressive than it sounds, because water is a genuinely difficult medium to breathe from.
The problem gills solve. Water contains far less oxygen than air — roughly 20 to 40 times less by volume — and it is around 800 times denser and considerably more viscous. A fish must therefore move a great deal of a heavy, oxygen-poor medium across its respiratory surface, and do so efficiently enough to make the effort worthwhile.
The structure. Gills consist of arches supporting rows of filaments, each carrying tiny folds called lamellae. This creates an enormous surface area packed into a small space — the same principle as lungs, arrived at independently.
Countercurrent exchange is the key mechanism, and it is what makes gills work at all. Blood flows through the lamellae in the opposite direction to the water passing over them.
Why that matters: if blood and water flowed the same way, they would reach equilibrium partway along and exchange would stop, capturing at best half the available oxygen. Flowing in opposite directions maintains a concentration gradient along the entire length — blood always meets water slightly richer in oxygen than itself. Fish can extract up to 80% of the dissolved oxygen this way, against roughly 25% for human lungs from air.
Getting water moving. Most fish use buccal pumping — opening the mouth, closing it, and forcing water over the gills. Fast swimmers such as tuna and many sharks use ram ventilation, swimming with the mouth open, and some must keep moving to breathe.
Why fish suffocate in air. Gill filaments are supported by water. Out of it they collapse and stick together, and the surface area vanishes.
Exceptions exist — lungfish, labyrinth fish and mudskippers all breathe air by different means.