To adapt, they had to either remain in low salinity environments, such as bays and estuaries, or they had to evolve mechanisms to replace water lost through osmosis to the seawater and to remove salts absorbed from the increasingly saline oceans. To inhabit freshwater, fish had to replace salts lost through diffusion to the water and eliminate excess water absorbed from the environment. Kidney function had to be altered accordingly for fish to survive in these different habitats. In seawater, fish must drink salt water to replace lost fluids and then eliminate the excess salts. Their kidneys produce small volumes of fluid containing high concentrations of salt.
Freshwater fish produce large volumes of dilute urine, which is low in salt.
Less demand is placed on the kidneys to maintain stable concentrations of blood salts in brackish or low salinity waters. Ultimately, fish adapted to or inhabited marine, fresh or brackish water because each environment offered some competitive advantage to the different species. For instance, it has been suggested that euryhaline fish are able to eliminate external parasites by moving to and from fresh and saltwaters. Steven K. Webster, marine science advisor to the Monterey Bay Aquarium in California adds some perspective on fish that move between salt and freshwater. The approximately 22,000 species of fishes alive today live in virtually all sorts of marine and aquatic habitats that are not unduly toxic.