Adding sugar to onions is a short-cut trick that helps the onions caramelize faster. Onions have natural sugars that give onions a sweet, mellow flavor if they are cooked long enough. Fully caramelizing onions can take up to 30 minutes over low heat. If you want to speed up the process, you can add a teaspoon of sugar to the onions while they cook.