Baking powder is a leavening agent, which means that it causes the cake to rise. It works by producing gas bubbles that expand when heated and create a spongey effect in the cake batter.
Baking powder contains baking soda, which is a base, and a second ingredient that is acid that reacts with the baking soda to produce carbon dioxide gas. The second ingredient is usually monocalcium phosphate or potassium hydrogen tartrate. Here's what the reaction looks like with potassium hydrogen tartrate:
`NaHCO_3 + KC_2H_5O_6 ->NaKC_2H_4O_6 + CO_2 + H_2O`
Too much baking powder causes the production of too many gas bubbles. This can cause the cake to rise too fast then cave in at the top if it hasn't baked enough to support the structure. Too much baking powder also affects the taste of the cake. If too little baking powder is used the cake will not rise enough and it will be dense.