The Short answer is Osmosis.
But no one likes a short answer ;)
Lets start with what is Osmosis
Osmosis is the spontaneous net movement of solvent molecules through a semi-permeable membrane into a region of higher solute concentration, in the direction that tends to equalize the solute concentrations on the two sides.
that is taken straight off wikipedia here
So now that we know what Osmosis is, Lets take a look at fresh water fish. Their body is filled with many different minerals one of them being salt, because their blood is a higher concentration of salt than the water they live in water is constantly taken into the blood stream (due to osmosis). That is why fresh water fish are pretty much constantly urinating because they are taking in so much water.
This is why you should never put a gold fish in a small bowl and think its fine.
With salt water fish, its pretty much the exact opposite. Due to osmosis water is constantly going out of their body so they have to continue drinking sea water to replace it.
This is why a fish will never be able to survive in different water types.
A bull shark , or Zambezi is a salt water shark.
It Is able to store excess salt in their kidney's allowing them to survive in fresh water for a short period of time. Allowing them to swim up rivers to hunt.