Pickled eggs are something of an acquired taste. Most recipes will instruct you to soak hard-boiled eggs in a jar of vinegar, herbs, spices, and sometimes beets, and voila—you have a tasty, tangy snack.

Let's say you just want one pickled egg, though, instead of a whole batch. The place you're most likely to find one is at your local dive bar. As The Farmers Market Cookbook from 1982 stresses, "No self-respecting barroom would be caught without a jar of pickled eggs on the bar."

Although they're a rarer sight these days, you can still find purple pickled eggs bobbing in a vat of mysterious fluid at many watering holes across the country. But how did such a strange snack become a bar staple? According to Tales of the Cocktail, it all started with a clever marketing ploy.

Back in the 1860s, bars in New Orleans started advertising free lunches to lure patrons into the bar, and those meals typically came with a hard-boiled egg. This habit may have been copied from the French, but there are a few reasons why American bartenders started implementing it. For one, hard-boiled eggs can keep for several hours without being refrigerated, and bars typically had eggs on hand anyway since they're used in some punches and cocktails. There was also a third reason: "To make customers thirstier—and also to keep them from getting sloppily drunk," Everett De Morier writes in The Invention of Everything.

According to De Morier, bars eventually switched to pickled eggs due to health concerns. Pickled eggs can keep even longer than their hard-boiled counterparts, and it also eliminated the hassle of having to clean up the eggshells after the lunch hour rush. Although pickled eggs are popular across the pond in the UK, where a World Pickled Egg Championship has been held, the Germans are the ones who get the credit for introducing the snack to Americans.

"The eggs were popular with Hessian mercenaries and then migrated over to the Pennsylvania Dutch, who used a very simple practice to make them: The egg—or the cucumber or the beet, whatever they were pickling—was placed in a jar of spiced vinegar and left there," De Morier writes.

Oli Scarff/Getty Images

Around the same time that bars in NOLA started offering free lunches, pickled eggs also started appearing in German saloons in the U.S. before spreading to other, non-German establishments. Culinary historian Richard Foss believes their popularity was also a matter of taste: Pickled foods and some lagers simply work well together. "The influx of Germans changed America's taste about beer drinking," Foss tells Tales of the Cocktail. "I would very much suspect that they might have brought in a taste for these pickled things that go very well with lager as well."

It's still a popular bar snack in some parts of Germany, he says. Once Americans acquired a taste for pickled treats, the tradition endured for decades. Before Prohibition was enacted, it wasn't uncommon to see a jar of pickled eggs sitting next to a jar of pickled pigs' feet on the bar.

At some point in the hard-boiled egg's evolution, deviled eggs and Scotch eggs also became a popular bar treat, according to Punch. Nowadays, many pubs offer more enticing snacks like soft pretzels with cheese or fried jalapeño poppers, but if you're lucky, you just might encounter the humble pickled egg on your next night out.

"Never been to a bar with a jar of pickled eggs? Then you've never walked on the wild side," Duane Swierczynski writes in The Big Book O' Beer. "There's something special about people who have eaten a pickled egg from a jar with a layer of dust that would rival the Tomb of Tutankhamun."