The reason why caffeine dehydrates you is
the same as why alcohol dehydrates you. They
are both diuretics. They both trigger a
hormone in the body called anti-diuretic
hormone to try to regulate this. Salt on the
other hand just creates a unbalanced area of
sodium and other particle concentrations in
your body between your cells and the
surrounding areas.
The sodium in the food creates a higher concentration of salt and particles outside of the cells, therefore water is pulled out of the cells due to osmosis. The reason why you become thirsty is because your body is trying to get back to an equilibrium.