A water molecule is bent, not straight. Oxygen pulls the shared electrons toward itself, so the oxygen end carries a partial negative charge and the two hydrogens a partial positive one. That polarity is the whole story: everything water does follows from it.
The partial charges attract. The hydrogen of one molecule sits against the oxygen of the next in a hydrogen bond, weak on its own and constantly breaking and re-forming. Heating water spends energy on those bonds before the molecules speed up, which is why water has such a high specific heat. Cooling it locks the bonds into an open lattice, so ice takes more room than the liquid and floats.
Drop salt in and the same charges pull the crystal apart. Water molecules turn their negative oxygen toward each sodium ion and their positive hydrogens toward each chloride, wrapping every ion in a hydration shell. Water dissolves ionic and polar substances because it is polar itself, and that is what makes it the solvent every cell runs in.