Both baking powder and baking soda are leavening agents that cause baked goods to rise. Baking soda must be combined with an acidic ingredient which triggers the leavening action. The acidic ingredient could be buttermilk or yogurt. As soon as baking soda mixes with an acid, it is activated and must be baked right away.
Baking powder, on the other hand, already includes an acidifying ingredient. Mixing with moist ingredients is all it needs to be activated. Double-acting baking powder is usually recommended in baking as a second rise will be triggered during baking. This means that baking can be delayed some without ruining the end result.
When baking chocolate cakes, combine Dutch Process cocoa (which has been through a process that neutralizes its acidity) with baking powder. Combine natural cocoa (since its acidity hasn't been neutralized) with baking soda. Don't make substitutions or you may end up with a flat, dense chocolate cake!