The best defense against cakes and muffins that stubbornly stick to the pan is to properly prepare the pan before you add the batter, either by greasing or by greasing and flouring. This creates a slippery surface that encourages cookies and other batters to spread as they bake and then slide right off when done. Paint the pan with a pastry brush. Brushing on butter or shortening in even strokes ensures that you won't miss a spot.
Most bakers prefer shortening over butter.
Butter gives a sweet, rich flavor, but since it can brown or burn at a relatively low temperature, it makes a darker, more toasty-tasting crust than shortening does. Using clarified butter prevents browning, but it also removes much of butter's desirable taste. Spread the grease evenly. Baked goods will stick to any spot you miss, so apply a thin, even coat and pay attention to corners and edges. It's best to paint shortening or softened butter on the pan in even strokes with a pastry brush so you don't miss a patch.