How does sugar dissolve in cups of tea?

Sugar doesn't dissolve in cups of tea, it dissolves in the water that makes up the cups of tea.

Sugar molecules and water molecules attract each other. When sugar is added to water, the water molecules surround the sugar molecules, breaking apart the sugar crystals. Each of the separated sugar molecules is then dispersed among the molecules of water and are no longer noticeable when tasted from water on its own, i.e. the sugar has dissolved.