History and traditions
Sweet dishes became a separate course once sugar grew cheap in the 1700s and 1800s. Cakes mark birthdays and weddings almost everywhere. Ice cream spread with refrigeration, and pastry shops in Paris and Vienna set the styles that bakers still follow.
Food economy and industry
Desserts rest on sugar, flour, butter, eggs, cream and cocoa, and their prices move with those commodities. Bakeries and ice cream shops are common small businesses. Demand is seasonal: ice cream in summer, cakes and chocolate around holidays.