A cake can be one of many flavours and shapes, but all cake recipes have the same basic components: a base, such as wheat flour; a sweetener; a binding agent, such as eggs; a fat, such as butter; a liquid; and a leavening agent, such as yeast or baking powder.
Baking soda is also called sodium bicarbonate, and its chemical formula is 2NaHCO3. It is a leavening agent that causes a cake to rise by producing bubbles of carbon dioxide, or CO2, as well as the byproducts of water (H2O) and sodium carbonate (Na2CO3). This occurs according to the following formula: 2NaHCO3 = Na2CO3 + H20 + CO2. However, since sodium carbonate has a high pH, this can cause the cake to become bitter unless it is balanced with an acid.
Baking powder is baking soda (NaHCO3) that has already been neutralised with the addition of an acid (H+). Baking soda produces carbon dioxide as well as water (H20) and sodium (Na+) according to the following equation: NaHCO3 + H+ = Na+ + H2O + CO2. Baking powder produces more CO2 than baking soda, which means more bubbles in the cake mix and a softer finished product.
Egg yolks are an emulsifier that helps the oil-based and water-based components of the cake mix together. When eggs are cooked, the protein molecules become uncurled when exposed to heat and create new molecular bonds with other nearby protein molecules. When the egg is completely cooked, it helps form a protein network that gives the cake structure.