Why do you need to use baking powder and soda in baking?

Leavening Agents

Baking powder and baking soda are both leavening agents, which means they are substances that cause dough or batter to rise. They do this by releasing carbon dioxide gas when they come into contact with liquid.

Baking Powder:

Baking powder is a mixture of baking soda, an acid (usually cream of tartar), and a drying agent (usually cornstarch). When baking powder is added to a liquid, the acid reacts with the baking soda to produce carbon dioxide gas. The drying agent helps to keep the baking powder from clumping.

Baking Soda:

Baking soda is a base and requires an acid to react with to produce carbon dioxide gas. Baking soda is often used in recipes that already contain an acidic ingredient, such as buttermilk, yogurt, or lemon juice. If a recipe does not contain an acidic ingredient, you will need to add one, such as cream of tartar, in order for the baking soda to react and produce carbon dioxide gas.

Which One to Use?

In general, baking powder is the better choice for most baking recipes. This is because baking powder contains both the baking soda and the acid, so you don't need to worry about adding them separately. However, baking soda can be used in place of baking powder if you add an acid to the recipe.