100 grams of raw onion won't contain much sugar at all. but if you cook onions for a long time, you will evaporate a lot of moisture, thereby increasing sugar content by weight significantly. thus, 100 grams of caramelized onions will definitely increase the sugar content of a dish.