I've actually been speculating this for a while. When I take magnesium, I do feel more parched. Especially in the mornings.
Table salt is shitty because it's only sodium chloride. You will never find just sodium chloride in nature in a state fit for consumption. Sea salt or rock salt is a mixture of several minerals and that's how humans were meant to eat their salt. That being said, unless you're overdoing the salt intake, it won't dehydrate you because sodium and potassium salts are actually needed to maintain your water and electrolyte balance. Water itself is not good at hydrating.