Unfortunately, there’s no one set answer for this one. However, there are a few likely reasons, so if you see something that looks familiar then you’ll know what to do next time.
1. Oven Temperature
Ovens are extremely sensitive, and just because the dial says it’s at 175°C doesn’t mean that it necessarily is. Even something as small as opening the oven to check on the cake can drop the oven temperature and cause your cake to sink.
If you think your oven temperature might be slightly off, use a heatproof oven thermometer to check the real temperature of the oven and don’t open the oven to check on the cake until the first 80% of the cooking time has passed.
2. Your Raising Agents
For something you use so little of, raising/leaving agents play a massive part in how your cake turns out. If you’ve used old baking powder past it’s best before date or used too much leavening then it’s likely that your raising agent is the reason behind why your cake has sunk.
Baking powder and self-raising flour does lose its effectiveness over time, and the best before date is on there for a reason. Trust that and if you need to go to the shop to buy some more because your current product is expired then do it, it’s not worth the risk.
When they say you can have too much of a good thing, raising agents is one of them. If you add any extra raising agents above what the recipe has told you to use then the amount of air created within the cake will be more than the cake can support, causing it to rise then collapse.
As soon as you add your dry ingredients to your wet ingredients, that is when you are risking having your cake collapse. Beating too much air into the batter when combining the dry and wet ingredients can cause the batter to sink.
Make sure your mixing the batter gently, and that any additions are worked through as gently as possible in a smooth motion.