The first and most obvious benefit is: It makes baked foods sweeter. But it doesn't only make things sweeter. Like salt, sugar is a flavour enhancer that can elevate or amplify other flavours. For example, sugar can balance out bitterness when adding dark cocoa powder to baking. Sugar can also help brown your baked goods. Because sugar caramelises when cooked some pie crusts, for example, may contain a small quantity of sugar. Sugar is also hygroscopic, which means it draws water to it. This characteristic can be beneficial since it helps baked foods keep moisture, or it can be detrimental because a frosted cake may dry out very rapidly because the frostings' abundance of sugar draws moisture from the cake layers.