George Orwell declared that his strongest memory of the latter half of the First World War was not the slaughter but the margarine. “It is an instance of the horrible selfishness of children,” he wrote in his 1940 essay “My Country Right or Left,” “that by 1917 the war had almost ceased to affect us, except through our stomachs.” He underlined the moral relationship between bad food and bad character in Down and Out in Paris and London. “You discover that a man who has gone even a week on bread and margarine,” he wrote, “is not a man any longer.”

Orwell is scarcely the only writer to have been scarred by the butter substitute — the literature of postwar England is greasy with margarine. In 1919, D. H. Lawrence gratefully wrote to a friend, “The butter is a great kindness, for I sicken at margarine.” Evelyn Waugh, in his memoir, A Little Learning, recalls with distaste the “milkless cocoa and small pats of margarine and limitless bread” at boarding school. And W. H. Auden, who was also in school during the war, remembers reaching for a second slice of bread and margarine, something that was permitted, only to have a master acidly remark, “Auden, I see, wants the Huns to win.”

In Erich Maria Remarque’s classic war novel, All Quiet on the Western Front, German soldiers receive their ration of synthetic honey and play cards on the lid of a margarine tub. As a modern, industrialized butter substitute, margarine was a depressingly suitable food for the world’s first modern, industrialized war. Butter had been adulterated before — with carrot or turnip or lashings of salt, to hide its rancidity — but margarine made it wholly artificial. Born in a laboratory instead of a cow, it was at the vanguard of the artificial tinned, tubed, canned, bottled, and dyed food blitzkrieg of the twentieth century, which turned cuisine into chemistry.

Margarine thrives on adversity, and its origins are rooted in it. Margaret Visser’s Much Depends on Dinner provides a first-rate account of the circumstances leading to its invention. In 1869, a cattle plague in France prompted Emperor Napoleon III to offer a prize to anyone who could come up with a butter substitute to feed his army and people. Hippolyte Mège-Mouriès, the food chemist who won the prize, had impeccable credentials, having already developed a widely honored process for “making more bread with less flour.” His substitute for butter was an amalgam of beef tallow, milk, and udders, pressed and heated in his laboratory. Initially called oleomargarine (after oleic acid and margaric acid), the name was shortened to margarine (margarites means pearl in Greek, and the fatty deposits of margarine had a pearly sheen). Over the years, beef tallow was replaced by vegetable and cottonseed oils, and yellow dye was added to turn margarine’s unappetizing white lardiness into a more buttery yellow. It arrived in the United Kingdom as Butterine, but the aural kinship with butter was too close for England’s dairy farmers, and an 1887 law changed the name to margarine, soon cockneyfied to marg.

Cheaper than butter and longer-lasting, margarine became a breakfast staple of the working classes in England’s factory towns, where cows were scarce. H. G. Wells’ social satires are a handy index of the status of margarine in industrialized prewar England. In his 1905 novel, Kipps: A Story of a Simple Soul, for instance, the eponymous hero is raised on butter despite being a poor orphan, simply because his schoolmaster owns cows. Later apprenticed to a draper in a big town, Kipps is reduced to toast and margarine, but when he inherits a windfall and aspires to be a gentleman, the joy of his day is to wait longingly for teatime to arrive with a plate of “toce all buttery.”

The First World War changed everything. Even the upper and middle classes had to eat margarine. War rations were introduced to manage food shortages, and in England dairy was particularly hard hit, with German submarines torpedoing butter imports from Australia and New Zealand. As blocks of butter sank to the bottom of the ocean, the fortunes of margarine rose steadily. Rudyard Kipling captures this in Changelings, a poem about a butter-selling grocer’s clerk who enlists with the navy and returns after the war to his grocery.

Or ever the battered liners sank

With their passengers to the dark,

I was head of a Walworth Bank,

And you were a grocer’s clerk. I was a dealer in stocks and shares,

And you in butters and teas,

And we both abandoned our own affairs

And took to the dreadful seas. . . . Now there is nothing — not even our rank —

To witness what we have been;

And I am returned to my Walworth bank,

And you to your margarine!

Despite the rueful mockery that touches this seemingly lighthearted ballad, it was written in the shadow cast by the death of the poet’s beloved son, John. Kipling had pulled strings to get John enlisted and never forgave himself for pushing him toward the trenches. The jingoism that made Kipling a pillar of the War Propaganda Bureau is absent in this fine poem. What were all those deaths for, the poem dryly asks, if they only returned us to a cut-rate margarine version of peace?

By the time the war was over, margarine was a fait accompli, and the butter lobby, which had fought hard against it, decided to get a piece of the action. Dorothy L. Sayers’s 1933 novel, Murder Must Advertise, offers an entertaining window on the spin that ensued. When Sayers’s aristocrat detective, Lord Peter Wimsey, briefly joins an advertising firm as a copywriter, Green Pastures margarine is the first product he has to sell. With true Oxonian flair, he comes up with well-bred lines like, “It’s a far, far, butter thing,” which, however splendid, just won’t do. To start with, Wimsey is told, the client likes to have a cow in the picture:

“Why? Is it made of cow-fat?” “Well, I daresay it is, but you mustn’t say so. People wouldn’t like the idea. The picture of the cow suggests the taste of butter, that’s all. And the name — Green Pastures — suggests cows, you see.” “I see. Just something about ‘Better than Butter and half the price.’ Simple appeal to the pocket.” “Yes, but you mustn’t knock butter. They sell butter as well.” “Oh!” “You can say it’s as good as butter.” “But in that case . . . what does one find to say in favor of butter? I mean, if the other stuff’s as good and doesn’t cost so much, what’s the argument for buying butter?” “You don’t need an argument for buying butter. It’s a natural, human instinct.” “Oh, I see.”

But if Britain struggled through the war, Germany starved through it. The British navy blockade around Germany caused famine-like conditions in the country. In Swindled, her fascinating history of food fraud, Bee Wilson shows how the war turned Germany into a laboratory for the most outlandish fake foods. “They even came up with a new word for it: the experience of ersatz food.” Now widely used in English as an adjective for cheap or counterfeit, ersatz, in German, simply meant “substitute” or “replacement,” but by the end of the war it had acquired the connotation of inferior. Ersatz coffee (walnut shells flavored with coal tar), ersatz eggs (maize and potatoes), ersatz pepper (ash), and ersatz lamb chop (rice) were staples during these years, as were 837 varieties of ersatz sausage. Wilson quotes an Australian trombonist trapped in Leipzig saying she didn’t mind consuming rat; it was substitute rat she couldn’t bear. With lard and dripping in short supply, the Germans tried “producing fats from rats, mice, hamsters, crows, and even cockroaches. There was even a plan to extract protein from the wings of dragonflies.”

In the last two years of the war, Germany was even further reduced, to a state of “ersatz ersatz”: all the finer substitutes had been exhausted, and in their absence all kinds of dubious surrogates were packaged as food. Washing soda mixed with starch, for instance, was sold as butter — it came nicely packaged with a grand name that fooled no one. Ersatz food not only caused an outbreak of physical illness called ersatzkrankheit or “substitute sickness,” it also led to widespread feelings of moral inferiority and insubstantiality among the German people. The unrelenting diet of fake foods made them feel like fake people. “People started applying the term ersatz to everything, even themselves,” writes Wilson. “An Ersatzmensch was a substitute person, a simulacrum of a human being, who was no more real than the Ersatzbutter they spread on their Ersatzbrot.” Germany’s national memory of hunger and debasement in the First World War played no small part in stoking the vengeful rise of Nazism, though the Nazis were themselves to champion ersatz-ism as an act of patriotism during the next war.

The Ersatz Elevator, a children’s adventure novel published in 2001 as part of the enormously popular Lemony Snicket series, is a darkly funny riff on this phenomenon. In addition to a fake elevator door that hides a secret passageway, the story features a couple called the Squalors, an Aqueous Martini (cold water served in a fancy glass with an olive in it), a foul concoction called Parsley Soda, and a restaurant called Café Salmonella. A contemporary children’s mystery might seem an unlikely place for ersatz food to pop up, but the author Daniel Handler’s father was a Jewish German refugee from the Second World War, during which the ersatz phenomenon, cheered on by Goebbels, was at its gruesome peak. Handler’s novel is almost certainly a gloss on those poisonous years. He also pokes fun at the kind of food faddism that promotes cons like aqueous martinis simply by proclaiming them “in.”

The more indigestible irony of our times is that the once-disparaged ersatz butter has come to be regarded as a healthy food. Because of its relatively lower saturated fat content, margarine has gone from being the shortening of those with slender means to the shortening of the slender. No wonder, then, that the cultural theorist Roland Barthes wrote a critique of mass culture called “Operation Margarine.” In the end, he argued, the imitation is always embraced over the original, and precisely for the qualities it lacks.