When you have diarrhea you get dehydrated. In order to rehydrate properly you need to take a bit of salt with your fluids so your brain signals your body to retain the water rather than expel it. So the alleviation of those symptoms makes perfect sense! dehydration is quite serious indeed. We will die from lack of water in 3 days. We can survive without food for 30.
The best rehydrating drink has a bit of glucose/sugar in it as well as salt, and citrus for electrolytes. Basically it's limeade. Check out my FAQ, there's a post called Cleansing & Rehydrating drink for recipe. This is the recipe they've used in India for hundreds of years to combat dysentary. they have many more cases of such illness but fewer deaths per capita than the US because we use pediasure instead of simple limeade.