The sugar isn’t 100% essential to pickling garlic, however it does help to balance out the salty soy and tangy vinegar flavour, leaving you with a much more well rounded flavour.