When I pour the water on to the plate you noticed that the bottom sugar cube absorbs the colored water and it slowly moves upwards to the top sugar cube. This is because adhesive forces between the water molecules and the sugar molecules, along with cohesion with- in the liquid, allowed the water to move up the sugar cube tower against gravity. This process is called capillary action.
The reason sugar dissolves in a cup of coffee? It’s because of the way water molecules interact with molecules in other substances. A water molecule has powerful magnetic properties, because of the two positively charged hydrogen atoms stuck to a negatively charged oxygen atom.That is the thing we know as H2O.
This is what’s happening on a molecular level when you see the sugar cube getting wet and crumbling apart.
Water molecules are busily inserting themselves between sugar molecules. Eventually they come between all the sugar molecules, dissolving the sugar cube.