Both baking powder and baking soda are leavening agents; they release carbon dioxide to make baked products rise. Baking soda is bicarbonate of soda. It is an alkali and must be mixed with an acid in order to produce carbon dioxide. It is used in recipes that include an acidic ingredient such as citrus juice, buttermilk, yogurt, molasses, or chocolate but the proportion of baking soda to acid must be correct or a soapy flavor will be produced. It is important to use tested recipes to prevent that problem.
Baking powder is a mixture of baking soda and an acid such as cream of tartar in the correct proportion along with cornstarch to keep the two from mixing before they are put into a baked product. It is used in baked goods that don’t include an acidic ingredient.