I had that happen a couple times when I let the cake cool too long in the pan.
So if you are cooling the cakes in their pans, try cooling them on a rack out of the pan.
I figured it was moisture build up from sitting in the pans to cool. So now I always turn them out immediately onto a rack. Hasn't happened since.
Good luck figuring it out.
What brand of pan are you using? How are you preparing your pans (cake release, shortening & flour, collaring with wax paper, etc.)? What temp are you baking at? Are you overbaking? Why is your cake so much shorter than the pan?
Good questions ^.
The only time I have had a problem similar to this is neglecting to remove a cake as soon as possible from the oven.
Other issues it can be: amount of fat/liquid in balance with your dry ingredients, the way you've prepped your pans and the gluten in your cake flour/overmixing your batters.
This happens to me occasionally too, and it's usually when I had a suspicion that something was off in my measuring. I don't grease the sides of the pans so it isn't that, I bake only from scratch so it isn't a cake mix issue.I cool everything in the pans until they're cool enough to pick up without an oven mitt, so it isn't that. I seem to remember that it happens more often when I use a certain type of pan or a certain recipe, but I can't remember the specifics. I think it's an ingredient balance issue.