What does sugar do in cakes?

* Sweetness: Sugar provides cakes with their characteristic sweet flavor. The amount of sugar used in a cake recipe can vary depending on personal preferences and the desired level of sweetness.

* Texture: Sugar contributes to the texture of cakes by providing moisture and tenderness. It helps to keep cakes from drying out and becoming crumbly.

* Color: Sugar undergoes a process called caramelization when heated, which gives cakes their golden brown color.

* Volume: Sugar helps to create volume in cakes by trapping air bubbles during the mixing process. This results in a lighter and fluffier cake.

* Preservation: Sugar acts as a preservative in cakes by inhibiting the growth of bacteria and mold. This helps to extend the shelf life of cakes.