Hydrogen bonding occurs in water due to the large electronegativity difference between the hydrogen atoms and the oxygen atom.The oxygen attracts the shared pair of electrons towards itself leaving the hydrogen with a partially positive charge.This causes it to be attracted to lone pairs of oxygen on other water molecules forming a hydrogen bond.The formation of hydrogen bonds is what gives water its distinct properties.