Both are leavening agents, which mean that they are used in baked goods before baking to produce carbon dioxide that will allow the material to “rise” as in cakes, muffins, and similar airy baked goods. And, to confuse things a little, baking powder does contain baking soda. The difference in the two ingredients is in the way they are used and they both require different conditions.
Baking soda, when combined with an acidic material like citric acid, buttermilk, and others, in the presence of moisture, generates bubbles of carbon dioxide at oven temperatures to cause the baking material to rise or become lighter. For example, if you add baking soda to vinegar, the carbon dioxide forms immediately. Think of the way children make a small volcano!
Baking powder has baking soda plus the cream of tartar, an acidifying agent, and starch, as a drying material. It is available as a single-acting or double-acting product. The single-acting baking powder reacts with moisture and must be baked immediately after mixing. The double-acting product reacts to some degree at room temperature to release some carbon dioxide, but releases the most when it is baked at higher temperatures causing the rising action.
It is possible to use baking powder in place of baking soda but it requires more than indicated by the recipe and it may cause taste differences. But, you cannot use baking soda in place of baking powder. Baking soda does not have the acid necessary to cause carbon dioxide production. The good news is that you can make your own baking powder by mixing two parts cream of tartar with one part of baking soda. That satisfies the need for the acid component. Or, you can just buy a cake! Thank goodness for carbon dioxide…