Perhaps you can recall from your high school or college chemistry class experiments that carbon dioxide bubbles are generated whenever water is poured over a dry acid and alkali mixture. Well, that is exactly what happens when you use baking powder, because this cooking ingredient is essentially a blend of acid (calcium acid phosphate, sodium aluminum sulfate, or cream of tartar, to name three) and alkali (sodium bicarbonate, popularly known as baking soda). Add water to this mixture and a chemical reaction results, producing carbon dioxide. The gas generated creates minuscule air pockets - or enters into existing ones - within the dough or batter.
When placed in a hot oven or on a hot griddle, the dough or batter rises, primarily for two reasons. First, the heat helps release additional carbon dioxide from the baking powder. Second, the heat expands the trapped carbon dioxide gas and air and creates steam. The resulting pressure swells the countless air pockets, which in turn expand the food being baked.