Why it happens
Cakes stick when there's nothing to stop the batter bonding to the metal as it bakes. Sugar in the batter can caramelise against the tin and act like glue. Tins that aren't greased and lined, or that have scratched non-stick coatings, are most likely to stick. Turning a cake out while it's very hot can make it tear, but leaving it to go cold in the tin can let the sugar set hard against the sides.