Oxygen is not as abundant in water as it is in the air, so for aquatic animals, oxygen concentration is a major limiting factor. The best way to ensure that enough water is "scanned" for oxygen at the gills is providing a really large surface area for gas exchange. Thus, each gill is formed by filaments. Each filament has secondary lamellae that rise perpendicularly to the surface of the filament. The total surface area is extremely large with respect to the volume of the gills.
Gills are exposed to the water with a lot of surface area and capillaries just below the surface. Gases are exchanged across the membranes. As the blood flows though the gills it gives up excess CO2 and gains oxygen.
They work great, thanks!