Margarine wouldn't exist without butter, of course. From its inception, margarine was an attempt to mimic the taste and texture of butter. In the 1860s, Emperor Napoleon III offered a prize to the person who could produce an edible fat substitute for butter. Hippolyte Mege-Mouries, a French chemist, created oleomargarine, a combination of clarified beef fat, water, and a bit of tributyrin--a milk fat--to give it a buttery taste.
Mege-Mouries called it oleomargarine after the fatty acid then called margaric acid. It turns out that margaric acid (named after the Greek word for pearl--margarites--for its pearl-like luster) is actually a combination of stearic and palmitic acids, fatty acids often found in animal fats