CookWise is an excellent resource to have on hand when you want to know how and why ingredients interact with each other. It will answer questions like why did my cake fall, why are my cookies so flat or why didn’t my bread brown.
When baking soda is combined with an acid it produces carbon dioxide gas which helps baked goods rise. It works well with foods that contain mild acids like chocolate, honey, molasses, sour cream and brown sugar. Large amounts of baking soda (3/4 teaspoon or more) in cookies does not contribute to leavening but helps them brown better.
Baking powder contains its own acids. It contributes to leavening but does not neutralize the acid in doughs like baking soda. Contrary to what you might think, too much baking powder will make baked goods fall.
An important characteristic of fats is that they all contain different amounts of water. Lard and shortening are 100% fat while butter is only 80% fat. So to make flatter cookies use butter.