Mycorrhizae is a type of fungus that collects around the roots of a cannabis plant. It consumes nutrients and the byproducts that it releases are actually easier for the plant to uptake.
The idea of adding sugar to the water, is that the myco fungus will actually consume the sugars, allowing it to spread through the soil. As a result, your plant is able to better keep up nutrients. Sort of like how you add yeast (fungus) to any sugary liquid, and the fungus will consume the sugars and create alcohol as a byproduct. But instead of alcohol, the byproduct is nutrients for the plant in this case.
Normally people use black strap molasses but any sugar could theoretically work. I would caution against overly refined sugar as it may have anti-binding agents or other things that may not be great for soil health. I would also advise against honey, since it is an antimicrobial substance naturally.