Baking is a both a science and an art. This article explains the science behind it.
In any baking recipe every ingredient has a purpose. For example, in a cake flour gives the structure, eggs bind the ingredients, baking powder and baking soda make it rise, fats like butter and oil make it less chewy, and sugar sweetens and keeps it moist.
Function of each ingredient
Baking soda and powder make baked goods rise. How does it do that? When mixed in batter, it makes carbon dioxide bubbles that help the cake to rise. As the cake bakes, the gas bubbles get trapped in the batter, which makes the cake light and fluffy.
Eggs help bind ingredients together. When it’s heated, the protein in the egg opens up and helps bind by making the batter into a semi-solid state. It also prevents crumbling and gives a smooth creamy texture.
Fats make our treats less chewy. They are awesome tenderizers. They coat the proteins in the flour, which prevents them from mixing with water and forming gluten.
Sugar adds sweetness and moistens our treats.
Flour gives the base and structure. There are 2 types of protein in flour called glutenin and gliadin. When water is added to the flour, the proteins come together and form a new protein called gluten. Later, inside the oven, the proteins and starches in the flour turn into a sturdy structure.
Every ingredient also needs to follow a certain proportion. For example if you put too much baking powder, the cake can crack. And if you put too little, it will be chewy and dense. Infact, once I put too much eggs in my cake batter and the cake became hard and heavy :(
Any system can function only if all it's parts do their job. The same principle applies to baking. Like with everything else, practice makes perfect. Most people follow a recipe when baking. As they get familiar with it, they tweak it to get better and better results. But to decide what to tweak, you need to first understand the science of baking!