For animals with gills, such as fish, the processes of gas exchange (extracting oxygen and expelling carbon dioxide) are more difficult to accomplish than for terrestrial creatures with lungs. The reason for this is that gases always flow from an area of high concentration to an area of lower concentration. On land, there is a much higher concentration of oxygen in the air than in water, so oxygen in the air naturally wants to go into the blood. With water, however, there is a much lower concentration of oxygen, so gas exchange is much more difficult. The gills of fish have to be very efficient at extracting oxygen from the water, so they employ something called the counter-current exchange.
The gills are comprised of folds of filaments that are rich in capillaries. Blood that is low in oxygen passes through the capillaries, and gets replenished. The blood flowing through the gills flows in the opposite direction from the water that passes over them. This enables a much more efficient method of extracting oxygen because the water is always encountering blood of a lower oxygen content, and likewise the blood is always encountering incoming water of a higher oxygen content. If the blood and water were flowing in the same direction always, then the blood would be encountering water of a progressively lower oxygen content, leading to a very inefficient system. The very simple configuration that allows for counter-current exchange enables fish and other aquatic animals with gills to get the most possible amount of oxygen, and live more efficient and active lives.