The polarity or ionic property of a compound determines its ability to dissolve in water. Water is a polar molecule and transmits a partial positive and negative charge between its atoms, enabling it to easily dissolve other ions and polar molecules.
When added to water, the molecules of polar or ionic compounds break up into ions and form hydrogen bonds with water. The water molecules then create a sphere of hydration around these individual ions and keep them dispersed.
In contrast, nonpolar compounds are hydrophobic and repel water molecules. The hydrogen bonding pattern of the water shifts to create a clathrate around the hydrophobic compound. This cage-like structure prevents the substance from dissolving.