All flour contains a certain percentage of protein, ranging from 8% for cake flour to around 13% for durum semolina (pasta) flour. When activated, these proteins cling together to form strands of gluten. There are two things that activate the proteins and develop gluten: the addition of liquid and mechanical action like stirring and kneading.
No matter what you're baking, you need at least some gluten for strength and structure...
When making pastries and cake, you want as little gluten as possible so that your delicate goodies stay light and airy. Most recipes will have you wait until the final step before combining the dry ingredients with the liquids. This way, the amount time that the proteins have to interact with the liquids before baking is kept to a minimum.
These recipes will also ask you to fold or gently stir the batter "just until combined" in order to limit the amount of mechanical action once the flour and liquids are brought together. A good rule of thumb here is to stir slowly and just until you can no longer see any dry ingredients.
When you're making bread, on the other hand, you want as much gluten as possible. This is why you want to use a flour with a higher protein content, why bread recipes have you add the liquid at the beginning of mixing, and why you knead the dough until it's elastic and springy (a sign that gluten development is well underway).
No need to fear gluten! It's just a matter of familiarizing yourself with what it is and the role it plays in what you're baking. We certainly made our fair share of hockey pucks before gradually learning to treat gluten as a friend instead of a foe.
More Kitchn Science and Bread
• What's the Deal with Whole Wheat White Flour?
• No-Knead Bread in a Hurry
• Baking Lab: Why Did Our Cake Fall Flat?
• Pantry Basics: What's the Difference Between Baking Soda and Baking Powder?
• Cooking Tools: Serrated Bread Knife
• Tip: Proof Bread Dough in the Microwave
(Photo by EmmaC)