This is due to the electronegativity of oxygen, flourine and nitrogen, which have a high electronegativity. In water, there are two bonds in each molecule, each linking one hydrogen to the oxygen atom. The electrons have less of an attraction to the hydrogen, and so the electron cloud is distorted in favour of the oxygen. So, as there are more electrons present near the oxygen relative to the hydrogen, the oxygen is more negative relative to the hydrogen, so causing polarity. Then, there is electorstatic attraction to neighbouring hydrogen or oxygen atoms.