A cake is a baked dessert, often topped with frosting or other decorations. Many recipes for cakes contain a basic batter of flour, fat (such as butter, oil, or margarine), and sugar, plus leavening agents such as eggs or baking powder. A wide variety of additional ingredients may be added, including fruits, nuts, cocoa, and extracts. The proportions of the basic ingredients, the manner in which they are mixed, and the types of pans used in baking all allow for limitless variations on this theme.

Cakes are usually served as a celebratory dish on ceremonial occasions, such as weddings, anniversaries, and birthdays. They may be served as a single, stacked layer or in multiple layers, filled with various fruits and other fillings, or iced with a wide range of frostings. Decorations such as flowers, icing sugar curls, and candied fruit are often used to further decorate a cake.

In modern times, cake making has become a relatively straightforward procedure, and a competent baker can produce an impressive and delicious cake without extensive prior experience or special equipment. This is partly because many recipes are now standardized and widely available in books, magazines, and online, with the basic ingredients and techniques well understood. However, some cake bakers struggle with success despite following a recipe to the letter and using expensive ingredients and equipment.

The key to a successful cake is the balance between structure and softness. The cake batter must be made with enough flour to hold the fat and sugar together, and the mixture must be moistened and airy. Traditionally, the ingredients were creamed to this end, with butter acting as a shortener and dissolving any starch in the flour. The beating also emulsified the sugar and created air bubbles in the batter. Today, a stand or hand mixer is normally employed to achieve this.

After a thorough beating, the eggs are added. The egg proteins coagulate around the fat-coated bubbles, stopping them from collapsing as they are heated in the oven. The eggs also provide the majority of the liquid needed by the batter. The batter is ready for baking when a finger poked into it resists re-embossing and the top of the cake has an appealing golden color, as evidenced by the Maillard reaction.

The batter is then divided among the pans as instructed in the recipe, and baked until the tops are lightly browned and a toothpick inserted into the center of the cake comes out clean. The cakes must be removed from the tins while still warm, and placed on racks to cool before they can be cut into individual slices. In many households, it is a tradition that the first slice of cake eaten on New Year’s Day belongs to Christ, the second to the Virgin Mary, and the third to St. Basil, the patron saint of cooks and bakers.