It's easy to confuse white sugar and table salt — we've certainly baked a horribly salty muffin or two in our day. But add a bit of water to these seemingly identical twins, and they're suddenly completely different animals. Both salt and sugar crystals start to dissolve in water, but sugar gets sticky and salt doesn't. Why is that?
Hydrogen bonds are the key to sugar's stickiness. Hanging out on its own, sugar is a solid, its molecules made of carbon, hydrogen and oxygen atoms. The crystals are intact and don't stick to one another — you can easily sift and pour sugar. But in the presence of a liquid, the formerly strong oxygen-hydrogen bonds in the sugar will start to break, and the loose hydrogen atoms will look for something else to stick to.
Some of the hydrogen atoms will stick to the closest surface, some will grab onto the hydrogen molecules in the liquid, and some will bond with another hydrogen or oxygen atom in the sugar. The result: a sticky mess. If you hold sugar in your hand, even a tiny amount of sweat can make things start to get sticky. Salt, on the other hand, is made of sodium and chlorine, so when it dissolves in water there's no hydrogen floating around to stick to anything.
But what about water? Its molecules are made partly of hydrogen, too — why doesn't it become sticky like sugar when combined with some other substance? It has to do with the fact that sugar is much more complex than water. A molecule of sugar contains 12 carbon atoms, 22 hydrogen atoms and 11 oxygen atoms — and many more hydrogen bonds than a molecule of water. When those bonds in the sugar get busted up, there's more opportunity for the molecules to grab onto whatever they're in contact with, including other sugar molecules. And the new bonds are more secure because there are so many of them — it's harder to pull them apart.
Each water molecule, on the other hand, is composed of only two hydrogen atoms and one oxygen atom, so it doesn't have as many "sticky spots." Water adheres better to surfaces than it does to itself — it beads up, forms puddles or soaks into the carpet.