Margarine is a water-in-oil emulsion, like butter, but made mainly from vegetable oils and fats such as palm, soybean or rapeseed oil. It was invented in France in 1869 as a cheaper substitute for butter, and most margarines contain around 80% fat, plus water, salt, emulsifiers, colour and flavourings.
Bakers use it for flaky and short pastry because it is firm, consistent and stays workable at warm temperatures, and it gives a buttery taste for less money than butter. In Alice’s Pineapple Pastry, margarine (17%) is the main fat in the crust, and Party Crispy Pie - Butter Caramel uses a little for a buttery note.
Older margarines were often made with partially hydrogenated oils, a source of trans fat; Thailand banned these oils in food from January 2019. Some margarines contain milk ingredients such as whey or buttermilk, so they are not always dairy-free.

