Sugar dissolves in water due to the interactions between its polar molecules and the polar water molecules. When sugar is added to water, the polar water molecules are attracted to the polar areas of the sugar molecules. This attraction causes the water molecules to surround the sugar molecules and pull them apart from their solid structure, allowing them to disperse throughout the water. This process is known as dissolution.
However, unlike ionic compounds such as salt, sugar does not dissociate into ions when it dissolves. Ionic compounds break apart into their constituent ions in solution, which is what makes them conductive to electricity. In contrast, sugar molecules remain whole and just disperse in the water. This is because sugar is a covalent compound, meaning that it consists of molecules held together by covalent bonds, which are not broken during the dissolution process.
In summary, sugar dissolves in water because of the attractive forces between sugar and water molecules, but it does not dissociate into ions like ionic compounds do because its molecular structure is covalent rather than ionic.