I'm not a chemist, but I play one on TV. Besides, I've already done the homework on baking powder.
Let's start with a couple of caveats before getting to general theory. Not all baking powders are the same. Not all baking powders are based on baking soda.
There are two basic types of baking powder, single and double acting. Single acting is usually composed of baking soda and a dry acid (like cream of tartar). Double acting is usually composed of baking soda, a dry acid, and a pyro-activator.
So... what's baking soda? Baking soda is sodium bicarbonate -- a buffering salt. In the presence of acid the sodium splits off to buffer the acid, while the carbon and oxygen form carbon dioxide gas. It's the gas itself which actually leavens the product.
There are a few problems with baking soda as a leavener. First, you only get as much leavening as you have liquid acid -- and you may not want to use a lot of liquid acid in your recipe. There is such a thing as too much citrus. Maybe.
Second, it turns cocoa red. Ever wonder how the tradition of "red velvet cake" began? Know you know.
Third, once the acid and baking soda mix, you've got almost no time to work with the product before you get it into the oven or you'll lose all the leavening -- plus the product is extremely fragile and it doesn't take much handling to degas the product -- leaving it heavy.
So, some wise guy figured out that if you mixed a "dry acid" with baking soda, the acid wouldn't potentiate the soda until the liquids were added, and any liquid that would dissolve the dry acid would do. Furthermore, the acid wouldn't fully dissolve immediately but would take a little time to autolyse. Moreover the acid to solution process would be made more efficient by heat.
Baking soda + dry acid = single acting baking powder. The dry acid employed is almost always cream of tartar. You can make it fresh at home if you like -- but given the cost of cream of tartar it's not economical. This stuff is very good when it's fresh. But you've still got to work very quickly.
Most modern cooks prefer double acting baking powder. This is often based on some other salt/carbonate than baking powder which works very much in the same way, and is often aluminum based. The typical additions are a dry acid (other than cream of tartar) and a heat activated dry acid (usually a pyro-phosphate). However, there are several different formulations -- partly in an attempt to avoid aluminum.
I should add that no harm has ever been shown from aluminum in baking powder; and that numerous studies show dietary aluminum is NOT associated with Alzheimer's. Furthermore, ALL of the current science indicates "studies" which do purport to show a linkage are poorly done, bunkum or both. Not to put too fine a point on it, the belief is purely superstition.
Whatever. Some double acting baking powders were created to tap into the anti-aluminum market. And a couple of them are VERY GOOD. Which goes to show something, but I'm not sure what.
It would take an awful lot of acid to be so much "acid" that it screwed up a recipe for a modern double acting baking powder. However, it could sure mess up a single acting powder recipe. The usual culprits though are delay and over handling.
Finally, when it comes to over-aging baking powder -- it depends on how it's made and stored. Once it's opened and used -- even if used occasionally it usually gets enough humidity to potentiate some of the dry acid. Also some of the products used as pyro-activators, although not the most common ones, don't age particularly well -- humidity or not.
Rule of thumb -- if it shows any signs at all of clumping it needs replacement. Don't even bother trying. Keep it very dry, it won't clump and will probably work for a very long time indeed. If it doesn't work buy new.
If you're an occasional baker the best thing may be to replace it annually, right around Thanksgiving. For one thing, you should be replacing a lot of your other dry spices annually. For another, most of the spices and baking supplies go on sale then. Cheap is good.
We bake a fair amount 'round here and use just enough baking powder that it's more economical to buy commercial size packages and throw the excess away when it gets old, than buy the individual cardboard tubes.
Hope this helps a bit,