Most ionic compounds are soluble in water because the electrostatic forces of the polar water molecules are stronger than the electrostatic forces keeping the ions together. There are several exceptions, however, where the electrostatic forces between the ions in an ionic compound are strong enough that the water molecules cannot separate them. Despite these few limitations, water's ability do dissolve ionic compounds is one of the major reasons it is so vital to life on Earth.
Water is a covalent compound composed of one oxygen atom and two hydrogen atoms. While the bond is classified as covalent, oxygen has a much higher electronegativity than hydrogen, so the oxygen atom receives the greater share of the electron charges from the bond. In addition, the hydrogen molecules are bonded at an angle less than 180 degrees from one another, making water molecules highly polar, with the oxygen side having a net negative charge and the hydrogen side having a net positive charge. This unusual structure and strong polarity are what give water many of its unusual properties, such as its high surface tension and thermal capacity, in addition to its ability to dissolve so many ionic compounds. Unlike most solutes, some ionic compounds, such as table salt, vary little in solubility with temperature.