If the submarine weighs more than the buoyant force, it sinks. If it weighs less than the buoyant force, it will rise. At this point, the submarine is neutrally buoyant. That is, there is no tendency for it to rise or sink so the submarine should remain at whatever level it was placed. Divers use this same principle when they add or let air out of their buoyancy vests in order to control their position in the water.
Bony fishes use a swim bladder to maintain neutral buoyancy.
Like the diver's buoyancy vest, this saves energy that would otherwise be spent maintaining vertical position. A submarine fills its tanks with water to submerge and pumps the water out to rise. After a torpedo launch, water must enter the diving hull to compensate for the loss of weight. Otherwise, the sudden unequal forces will drive the submarine to the surface. During WWII, German submarines routinely escaped detection by switching off their engines and taking advantage of the currents flowing in and out of the Mediterranean Sea.