When you bake cookies and cakes, you can see that a transformation occurred between the raw material you started with and the baked goods you ended up with. What actually happens when you pop a pan of cookies in the oven to bake at 350 ºF?
In the early stages of baking, when your dough warms above 32 ºC (90 ºF), fats begin to melt, releasing trapped air and water. After all, butter is 80 % fat, roughly, so there's more to it than just that.
The warming of fats temporarily makes doughs and batters more soft and delicate, or even more fluid. Batters become looser and cookies will start to spread.
If you notice that your cookies are spreading too much in the early stages of baking, it's probably because there's an excess of fat in the dough
Water boils at 100°C (212°F) at sea level, so once batters and cookie doughs heat up to that temperature, water will begin to evaporate, turning to steam and drying out the baked goods.
The water evaporates and the gas bubbles expand and rise between 35 ºC and 70°C (95 to 158°F), contributing to the rise of the cookies and cakes.
Evaporation also contributes to the crust of baked goods, further setting the exterior of cookies. Evaporation is what gives crinkle cookies their distinct cracked surface: the cookie dough dries out first, before the leavening agents react, forming cracks.
Proteins denature and set
As the dough continues to heat up above 60 ºC (140 ºF), eggs and gluten proteins begin to dry out and set. Starch granules swell with water and gelatinize up until about 93 ºC (200ºF). These steps are key to setting the structure of the cookie in place.
Leavening agents react
Baking soda and baking powder in cookie doughs will begin to react a little before the cookies hit the oven, at room temperature, releasing a small amount of carbon dioxide gas that will lead to a little expansion. Usually, heat is necessary to help them react more (this is especially true for double-acting baking powders, which contain a slow-acting chemical leavener that requires more energy to leaven baked goods).
Above 149 ºC (300ºF) is the sweet spot where sugars caramelize and the Maillard browning reactions occur. Both of these contribute to that “golden-brown delicious” colour and flavour we love in baked goods.
Usually, browning will occur mostly on the exterior and the interior won't reach such a high temperature. That's why cakes and cookies have a golden crust and a soft, pale interior.
Caramelization of sugars occurs above 160°C (320°F) and will mostly occur on the edges of baked goods that are in direct contact with metal bakeware.
Maillard browning takes place above 105°C (220°F). The pH of the batter or cookie dough has an impact on browning, specifically Maillard browning: under acidic conditions, Maillard reactions are less likely, leading to baked goods that don't brown as well when baked. On the other hands, too much baking soda can lead to an excess of browning reactions and a very dark colour that might not be desirable.
Following a recipe and baking seems very simple but actually, a lot of complex transformations and reactions occur when you bake cakes and cookies.