In 1944, a Warner Bros. cartoon euphemized World War II through Bugs Bunny and ice cream. Marooned in the Pacific under Japanese attack, Bugs commandeers an ice-cream truck and begins handing out “Good Rumor” bars, which turn out to be chocolate-covered grenades. The bars explode, and Bugs drives off. “Business is booming,” he cracks.

There’s a lot wrong with this infamous cartoon. The dialogue includes racial epithets and the animated Japanese soldiers are depicted as yellow-faced. One thing it does get right, though, is the notion of ice cream “booming” as America’s secret weapon during the war. Ice cream in fact played a significant role in the nation’s wartime efforts—and would be used for support in the military-industrial complex for decades.

Before World War II, the military’s food concerns were largely relegated to ensuring that soldiers consumed enough calories to march (and that civilians and refugees consumed enough to endure). During the First World War, this was the job of Herbert Hoover, the first administrator and wartime consigliere of the U.S. Food Administration. He succeeded on the platform that “food will win the war,” persuading American households to “Hooverize” meals by sacrificing wheat, sugar, meat, and fat (the origin of Meatless Mondays and Wheatless Wednesdays). The result was a rapid tripling of food exports, yielding more than 18 million tons of food staples for the war effort in America’s first full year of war alone.

But the ice-cream industry, still in its infancy, demanded even more for the boys overseas: not just calories, but comfort. An editorial in the May 1918 issue of The Ice Cream Review, a monthly trade magazine, spooned out sharp criticism for the scant availability of ice cream overseas: “If English medical men knew what ours do every hospital would keep ice cream on hand for patients.” It cried for Washington to intervene by subsidizing Allied ice-cream factories throughout Europe:

In this country every medical hospital uses ice cream as a food and doctors would not know how to do without it. But what of our wounded and sick boys in France? Are they to lie in bed wishing for a dish of good old American ice cream? They are up to the present, for ice cream and ices are taboo in France. It clearly is the duty of the Surgeon General or some other officer to demand that a supply be forthcoming.

The ice-cream industry didn’t have much lobbying power. Few Americans had refrigeration. Worse, Hoover had downplayed the scarcity of domestic sugar supplies, hoping to avoid a panic. There was hardly any sugar left for America, let alone for allies in France and England—and the promotion of ice cream as a wartime cure-all wasn’t helping. Instead of bolstering ice cream production, Hoover’s Food Administration ordered a reduction of manufacturing domestically—ruling in the summer of 1918 that “ice cream is no longer considered so essential as to justify the free use of sugar in its manufacture.”

That stance would change drastically during the next two decades, however—owing partially to the unlikely contributions of Prohibition and the Great Depression. When the 18th Amendment outlawed the sale of spirits in 1920, many early American breweries, including Yuengling and Anheuser-Busch, turned to soda and ice cream to stay afloat. By the end of the decade, Americans were consuming more than a million gallons of ice cream per day—and, crucially, associating it with the comfort and diversion formerly assigned to alcohol.

The ice-cream maker William Dreyer helped further this sentiment in 1929 when he marketed Rocky Road as a culinary metaphor aimed at helping people cope with the crash of the stock market. The term now refers to just chocolate with chopped nuts and chunks of marshmallow, but it used to be symbolic of comfort—a sweet indulgence juxtaposed with broken, “rocky” pieces.

When World War II hit, countries on either side of the conflict once again banned ice cream, with Britain adding insult to injury by endorsing carrots on sticks as a wartime substitute. But the United States doubled down. Ice cream had become inseparable from the American way of life—and, from that point forward, from military tactics.

In 1942, as Japanese torpedoes slowly sank the U.S.S. Lexington, then the second-largest aircraft carrier in the Navy’s arsenal, the crew abandoned ship—but not before breaking into the freezer and eating all the ice cream. Survivors describe scooping ice cream into their helmets and licking them clean before lowering themselves into the Pacific. By 1943, American heavy-bomber crews figured out they could make ice cream over enemy territory by strapping buckets of mix to the rear gunner’s compartment before missions. By the time they landed, the custard would have frozen at altitude and been churned smooth by engine vibrations and turbulence—if not machine-gun fire and midair explosions. Soldiers on the ground reported mixing snow and melted chocolate bars in helmets to improvise a chocolate sorbet.

The U.S. Navy spent $1 million in 1945 converting a concrete barge into a floating ice-cream factory to be towed around the Pacific, distributing ice cream to ships incapable of making their own. It held more than 2,000 gallons of ice cream and churned out 10 gallons every seven minutes. Not to be outdone, the U.S. Army constructed miniature ice-cream factories on the front lines and began delivering individual cartons to foxholes. This was in addition to the hundreds of millions of gallons of ice-cream mix they manufactured annually, shipping more than 135 million pounds of dehydrated ice cream in a single year

The cherry on top came a decade later during the Korean War, when General Lewis B. Puller tried to convince the Pentagon that ice cream was a “sissy food” and that troops would be tougher if indulged with other products of American culture, namely beer and whiskey. The Pentagon responded with an official statement ensuring soldiers were served ice cream a minimum of three times a week.

Beyond its military “boom,” America’s comfortable connotation of ice cream goes back to its founding. George Washington spent about $200 on ice cream in a single summer—more than $5,000 in today’s dollar—and Thomas Jefferson studied ice cream production in France before returning to Monticello with a sorbetière, four ice-cream molds, and a handwritten recipe for vanilla ice cream that’s still archived in the Library of Congress. Immigrants to Ellis Island were traditionally fed ice cream as part of their first American meal—a gesture ordered by the island’s commissioner and preserved in a headline from the summer of 1921: “Ellis Island Authorities Gently Lead Immigrants to Appreciation of Good Points of America by Introducing Them to the Pleasures of Ice Cream Sandwiches.”

So why ice cream? In her book Much Depends on Dinner: The Extraordinary History and Mythology, Allure and Obsessions, Perils and Taboos of an Ordinary Meal, Margaret Visser suggests that there are two types of ice cream-induced nostalgia. The first is for childhood memories, which “makes people feel young and at least temporarily secure and innocent,” and the second is more complex: what she calls a nostalgia “for Elsewhere.” For some, that might mean memories of summer vacations or seaside boardwalks—or, for fans of Häagen-Dazs, images of Scandinavian luxury, even though the name and umlaut are gibberish.

An Austrian study on the neurological effects of food seems to support this. Researchers found that only ice cream lowered the human startle response in men and women (at least when ingested by syringe), whereas chocolate and yogurt did not produce statistically significant outcomes across genders. This indicates that the comfort of ice cream runs deeper than the physiological effects of sugar, fat, temperature, and perceived sweetness. The phenomenon, it appears, is largely psychological, a result of the learned associations pairing ice cream with childhood birthday cakes; first dates; and, for soldiers on deployment, the comfortable “elsewhere” of home.