Why is water transferred from a beaker of pure water to a beaker of sugar solution when placed in the a closed container?
Water molecules in gas phase collide and are absorbed by both solutions at the same rate, assuming the same humidity over the solutions.
OTOH, as sugar solution has lower molar fraction of water than water itself,  its rate of water evaporation is lower than pure water evaporation.
Therefore, there is the net transfer of water molecules from the water beaker to the sugar solution beaker.
It can be formulated also by other way: The saturated vapor pressure over sugar solution is lower than over pure water.  Therefore vapour saturated over water is oversaturated over sugar solution. And vice versa - vapor saturated over sugar solution is undersaturated over water.