I got curious about all this a couple of years ago since both are chemical levening agents - so I did a little research.
Baking soda (an alkali) needs an acid to react with to produce carbon-dioxide bubbles - something like buttermilk, lemon juice, mollasses, etc. The chemical reaction begins at room temp as soon as the wet and dry ingredients are mixed together. It gives you one rise.
Baking powder containes both an alkali and an acid - so it can be used in recipes that don't include an acid. Like baking soda - the chemical reaction begins as soon as the wet and dry ingredients, Double Acting Baking Powder (the kind most commonly found in the store) has 2 alkili/acids - one that reacts at room temp and another that doesn't begin until heated - so you get a double rise.
If a batter is too acidic then not all of the acids in the baking powder will react and can leave a bitter taste. So, the baking powder is reduced slightly and baking soda is added - the baking soda to react with the extra acid.
"It ain't what you don't know that gets you in trouble. It's what you know for sure that just ain't so." - Mark Twain