Margarine is a butter substitute made primarily from refined vegetable oils and water. It was originally created as a cheaper alternative to butter and has been widely used in cooking and baking. The composition of margarine can vary, but it often contains trans fats, which have been scrutinized for their health effects.