The electrostatic attraction between the partial positive charge between the hydrogen atoms and the partial negative charge close to the oxygen allows a hydrogen bond to form.
Polarity is responsible for the tendency of ions and other molecules to dissolve in water. The hydrogen bonds are responsible for many other peculiar properties of water. Ice floats, for example, since hydrogen bonds pull water molecules farther apart in a solid than in a liquid, where there is one fewer hydrogen bond per molecule.
Hydrogen bonding is also due to the unique physical properties, including high vaporization energy, low surface tension, high specific heat, and almost universal liquid solvent properties. Another unique property of water caused by hydrogen bonds is the hydrophobic effect or exclusion of compounds containing carbon and hydrogen. In the formation of cell membranes, the hydrophobic effect is particularly important. The best description is to say that water is ‘squeezing’ together non-polar molecules.