It's mostly due to moisture absorption from the air. Basically, baking powder is a mixture of a base - baking soda (sodium bicarbonate or similar) and a weak acid, usually tartaric acid (potassium bitartrate) and/or monocalcium phosphate or a similar acid.
Alone and dry the acid and base are more or less inert and won't break down substantially at room temperature, but if you mix the two together and add moisture, the acid and base solubilize and react. This is what happens when you add them to your baking, and is exactly what you want to happen to get the bubbles of carbon dioxide produced to rise your batter. The heat of the oven causes a faster reaction and expands the bubbles to make bigger spaces in the baking, resulting in the rising effect.
However, at room temperature both the acid and the base are hygroscopic to some extent, so they absorb moisture from the air over time and even this tiny bit of moisture results in a small bit of the reaction and degradation of the mixture.
There's a bit more explanation in the wikipedia article on Baking powder.