What is the difference between ~ (tilde) and \, (backslash comma) for a nonbreaking space?
The difference between a normal unbreakable space and a thin unbreakable space:
~ is, if I'm not mistaken, what TeX denotes
\fontdimen2, the interword space.
5~kg will not be broken across lines but can be stretched, if needed by TeX:
5\,kg cannot be stretched.