If the second glass of water has no salt in it, then salt will start crossing the membrane and equalising the salt levels in both glasses. However, if the second glass of water already has some salt in it, then the first glass will lose less salt through osmosis to the second glass.
Now, imagine the first glass is your blood, and the second glass is your waste water. By measuring the salt levels in the first glass, we can estimate the concentration of salt in the second glass, and therefore how much water is being cycled through.
You can also measure serum sodium in urine, but urine tests are more significantly impacted by recent consumption (e.g. if I drink a big glass of water a few hours before the test, likely the serum sodium levels will be significantly lowered), regardless of general trends. This means they're normally used as a secondary diagnosis tool in case blood sodium is abnormal to validate kidney function.