You may not have taken home economics and chemistry from the same teacher when you were in high school, but chemistry and baking have a lot in common. For a cake or cupcakes to form as they're supposed to, ingredients must be mixed in the correct way, in a certain order, and baked at the right temperature. Baking isn't as hard on the nerves, though. Your cupcakes may fall, but they probably won't explode.
Video of the Day
Many of the ways cupcakes can go wrong begin with the mixing process. Cupcakes won't rise well if you don't cream enough air into them, but if you cream in too much air they'll rise high and then fall. They'll also collapse in the middle if the eggs aren't mixed into the creamed butter thoroughly enough, because it's the eggs that emulsify the fat and milk together into a coherent dough. This means the eggs and milk will separate, resulting in a tough dough that sinks in the middle.
Recipe and Proportions
Many recipes are poorly constructed or contain errors, which doom your best efforts before you ever start. The key to evaluating recipes is to understand the necessary proportions. This is easier to do with professional recipes, because they're measured by weight, but you can use a kitchen scale to check the familiar recipes you use. In a regular butter cake, the weight of sugar should be equal or less than the flour, the fat equal or less than the eggs, and the eggs and milk together should equal the weight of flour. Too much liquid is a common cause of cupcakes falling.
Measuring and Ingredients
When the recipe is correct, similar problems can be caused by not measuring your ingredients accurately. Set your measuring cups on a flat surface before measuring liquids, don't do it while you're holding the cup in the air. Don't scoop flour with the measuring cup, spoon it into the cup instead and level the cup by swiping off the excess, not by tapping. Too much liquid, too little flour, too much sugar or too much baking powder will all cause your cupcakes to fall.
Assuming that your recipe works properly, and that you've measured and mixed the ingredients correctly, you still have to bake the cupcakes successfully. If the temperature is too low, they won't rise properly and will leave a small crater in the center. If the oven is too hot, they'll puff mightily and then collapse. They'll also fall if the oven is jostled or the door is slammed, while they're risen but not yet set. Baked cupcakes will collapse in the middle if they are taken out of the oven before they're quite baked through, or if they cool too rapidly.
Most of the problems found in butter cake batter are also found in sponge cake batter, with a few extra ones for good measure. Sponge cakes rely on beaten egg whites for most of their volume. Egg whites won't achieve their best volume if any yolk or other fat gets into the whites before they're whipped, or if they're too cold. If the egg whites aren't folded into the batter with a delicate enough hand, you'll lose much of your volume and the cupcakes may be cratered in the middle. Sponge batters are especially susceptible to shaking and banging as they bake.