The pursuit of culinary excellence is part art, part chemistry. Wiht leavening agents, it’s all chemistry.
Baking powder and baking soda are chemical leaveners. They work by producing carbon dioxide gas, which lightens and aerates the batter.
Baking soda, also known as sodium bicarbonate, is an alkaline chemical. When combined with moisture and acidic ingredients it produces carbon dioxide. Acidic foods are things like buttermilk, molasses and yogurt. Baking powder contains sodium bicarbonate and an acidic agent, usually cream of tartar. The acidic agent counterbalances the alkalinity. Most baking powder is double-acting. It reacts first with the moist ingredients in the batter and again when heated.
Baking powder and baking soda can be used individually or in combination depending on the acidity of other ingredients.