Baking Soda is pure sodium bicarbonate, a base which requires contact with an acid to react. In baking, such acids may be found in buttermilk, yogurt, or vinegar, among other things. This reaction produces carbon dioxide (CO2) in the form of bubbles, When making baked goods, the process is called “chemical leavening,” because the trapped CO2 gas makes the dough or batter rise. When baking soda comes into contact with an acid, it reacts immediately. And that can be a problem. For many baking recipes, you want an extended reaction, so that the rising doesn’t take place all at once
Baking powder addresses this problem because it is “double acting” – Besides containing the same sodium bicarbonate found in baking soda, it contains two different acids that create CO2 gas at different stages of the baking process. These acids won’t start reacting with the sodium bicarbonate until after you’ve put the dough or batter in the oven. This means that the batter rises for a longer period of time, making lots of bubbles (and a fluffier cake, muffin, or whatever).
Both baking powder and baking soda work by releasing carbon dioxide gas. This gas forms bubbles in the dough, causing it to rise. While the dough is cooking, these bubbles harden as it’s baked. Don’t try to substitute one for the other though, alterations in rising and taste will likely be the result.