Cakes usually sink when the cake batter is not completely cooked; everyone’s ovens are different so you need to find the optimum baking time for you oven. Also towards the end of baking test the cake repeatedly to see if it is fully baked. A skewer inserted into the cake does not always mean that your cake is done, this is especially true for very light and airy cakes.
However other things can be the problem, here are a few:
Over beating the batter and incorporating too much air – the air can then cause a collapse.
Temperature of the oven is too high causing the cake to rise too rapidly. Tip: Invest in an oven thermometer to check your oven temperature.
Opening the door to check on the cakes before the batter is set can cause the cake to sink, as can closing the oven door too sharply in the early stages of baking.
Placing the baked cakes to cool in a drafty place.
Poor recipe, baking is a chemical reaction so the proportions have to be correct.
But generally MOST cakes sink/dip because their outer edges were fully cooked but the center was not!