Sodium bicarbonate (baking soda) is the baking world’s go-to chemical bubbling agent. It’s a crystalline alkaline powder which, once it’s combined with water, dissolves into sodium ions and bicarbonate ions, the latter of which react with acid to create carbon dioxide gas.
That’s all very straightforward, no? However the interesting thing about baking soda is that you can get reactions of different speeds depending on what sorts of acids you pair it with. Common kitchen acids (acetic acid from vinegar, lactic acid from sour cream) generally yield fast reactions, which is why it’s usually important to hustle anything leavened solely with baking soda into the oven as soon as you’re done mixing. This is especially true if the mixture is a fairly liquid batter, since a.) water facilitates a baking soda reaction and b.) CO2 bubbles will rapidly rise out of a liquid.
There are however acids that deliver rather slower reactions. I’ll discuss those in the post on baking powder, since sodium bicarbonate is a component of that as well.
I should say that when using baking soda it’s important that you have enough acid in your mixture to react all of it. Unreacted soda has a salty, sour taste. But it can deliver far worse tastes than that if the batter you’re making has much fat in it. For soda + fat + heat = soap, which is a very unwelcome thing indeed in a cookie.