Cocoa powder comes in two main varieties, natural and Dutch process, and they are not always interchangeable. Acid is an important part of the reactions in baking and the two types of cocoa powder vary greatly in their acidity.
Natural cocoa powder is made from cocoa beans that are roasted and then ground into a fine powder after most of the fat is removed. Natural cocoa powder is acidic and often paired with baking soda (an alkali) in recipes to balance the flavor and create carbon dioxide bubbles that help baked goods rise in the oven.
Dutch process cocoa powder is made in a similar process except using cocoa beans that have been washed in a potassium solution to neutralize their acidity. Dutch process cocoa powder is darker in color, less acidic and has a more mellow, smoother flavor than natural cocoa powder. Since Dutch process cocoa powder is not acidic, it will not react with baking soda to create lift and rise in baked goods. It also will not balance the pH of the baking soda and can result in a bitter flavor.
Using the wrong type of cocoa will can result in dense, gooey textures or soapy, bitter flavors.
Tip for Better Baking: For the best results, always use the variety of cocoa powder (natural or Dutch process) that is called for in the recipe. If the recipe does not specify, use natural. If the recipe does not contain baking power or baking soda, you can use either natural or Dutch process cocoa powder.
What should you do if the recipe does not specify the type of cocoa powder? Use natural cocoa powder. Most American recipes use natural cocoa powder and will specifically call for Dutch process if that is what is required.
If no chemical leaveners are used in a recipe (such as ice cream, dessert sauces, and even some brownies), then either variety of cocoa powder can be used and you should choose the one you like best.
To mean more about the differences between natural and Dutch process cocoa powders, check out this article from Serious Eats, this FAQ from David Lebovitz, or these tips from Alice Medrich on Food 52.