Why does a cake rise and then collapse?
This is the clearest example on the whole site of why the four pillars aren't really separate. A collapsed cake is never one system failing -- it's two systems racing, and the losing one lost.
The kitchen answer
A cake collapsing after it rose almost always means the gas expanded faster than the surrounding batter could set around it. Rising and setting are two separate races, run by different systems, and collapse is just the setting race losing.
What's actually happening
Leavening -- soda, powder, or yeast -- produces CO₂ that expands and pushes the batter upward for as long as it's being produced and the batter is still soft enough to stretch. See Leavening for how each leavener's timeline differs.
Meanwhile, two separate systems are racing to lock that expanded structure in place before it can fall back down: egg proteins coagulating (roughly 60–85°C depending on dilution) and starch granules gelatinizing (roughly 60–70°C), both stiffening the crumb from a stretchy batter into a fixed solid.
Sugar slows both of those setting processes down -- it competes with the proteins and starch for water, delaying coagulation and gelatinization alike. That's useful up to a point (it buys the rise more time to happen) and a liability past it (too much sugar and the structure sets too late to catch the gas at all).
What does that mean for your recipe
A cake that rises beautifully in the oven and then sinks in the middle after coming out usually wasn't "underbaked" in the raw-batter sense -- it was pulled before the protein/starch network had fully set, so what looked done on top hadn't caught up underneath. The fix is almost never "more leavening": extra gas just accelerates a structure that's already racing to keep pace.
What can go wrong
- Sank right out of the oven: underbaked -- gas production outpaced protein/starch setting, and the structure gave way the moment external support (the pan, the oven's heat) was removed.
- Sank only in the middle: a classic sign the center never fully set even though the edges did -- often oven temperature too low, or the door opened too early, cooling the center before it finished gelatinizing and coagulating.
- Over-leavened collapse: too much soda or powder produced gas faster than the structure could ever keep pace with, regardless of bake time -- past a point, more leavener isn't more height, it's instability.
- Dense collapse in sugar-heavy batters: excess sugar delayed setting so long that the gas had already escaped by the time the structure finally caught up.
Try it yourself
Same batter, one variable -- how long it bakes:
- Bake two identical cake batters side by side, in identical pans.
- Pull one about 5 minutes before your usual done-time; let the other finish fully.
- Let both cool undisturbed and compare whether either sinks in the center.
Watch for: the underbaked cake visibly deflating in the center within minutes of coming out, while the fully-baked one holds its risen shape -- direct evidence that "rise" and "set" are genuinely different events, not the same thing measured twice.
Go deeper
This is really a race-condition problem: the leavening system's timeline (how fast, and for how long, it produces gas) has to roughly match the structural systems' timeline (how fast egg protein and starch actually set at your oven's real internal temperature). Structure too slow relative to gas production means collapse; structure setting too early means less gas ever gets trapped in the first place, producing a dense but stable crumb instead.