They form hydrogen bonds with each other.
The electronegative oxygen bonds to electropositive hydrogens on other molecules. This intermolecular attraction is what causes water to have such a surprisingly high boiling point, what causes it to expand on freezing, what makes it such an excellent solvent for polar molecules, etc.