Fish have a swim bladder that allows them to maintain their position within the water with very little effort. It was believed that before this buoyancy organ evolved in fish, they would have needed to swim constantly in order to maintain their depth. Many experts on fish evolution believe that the eventual development of the swim bladder allowed fish to swim slower and become more maneuverable and agile, and that these free swimming habits were accompanied by changes in body form and fin shapes, forms and function. All of this, they argue, allowed fish to occupy every possible habitat in the seas.
To learn more, read The Internal Anatomy of a Fish.