The hamburger is one of the world’s most popular foods, with more than 40 billion served up annually in the United States alone. Although the humble beef-patty-on-a-bun is not much more than 100 years old, you can’t tell the story of its origin without outlining a far greater lineage, linking American businessmen, World War II soldiers, German political refugees, medieval traders and Neolithic farmers.

The groundwork for the ground-beef sandwich was laid with the domestication of cattle (in Mesopotamia around 10,000 years ago), and with the growth of Hamburg, Germany, as an independent trading city in the 12th century.

Jump ahead to 1848, when political revolutions shook the 39 states of the German Confederation, spurring an increase in German immigration to the United States. With German people came German food: beer gardens flourished in American cities, while butchers offered a panoply of traditional meat preparations. Because Hamburg was known as an exporter of high-quality beef, restaurants began offering a “Hamburg-style” chopped steak.

In mid-19th-century America, preparations of raw beef that had been chopped, chipped, ground or scraped were a common prescription for digestive issues. After a New York doctor, James H. Salisbury, suggested in 1867 that cooked beef patties might be just as healthy, cooks and physicians alike quickly adopted the “Salisbury Steak”. Around the same time, the first popular meat grinders for home use became widely available (Salisbury endorsed one called the American Chopper) setting the stage for an explosion of readily available ground beef.

The hamburger seems to have made its jump from plate to bun in the last decades of the 19th century, though the site of this transformation is highly contested. Lunch wagons, fair stands and roadside restaurants in Wisconsin, Connecticut, Ohio, New York and Texas have all been put forward as possible sites of the hamburger’s birth. Whatever its genesis, the burger-on-a-bun found its first wide audience at the 1904 St. Louis World’s Fair, which also introduced millions of Americans to new foods ranging from waffle ice cream cones and cotton candy to peanut butter and iced tea.

Two years later, though, disaster struck in the form of Upton Sinclair’s journalistic novel The Jungle, which detailed the unsavory side of the American meatpacking industry. Industrial ground beef was easy to adulterate with fillers, preservatives and meat scraps, and the hamburger became a prime suspect.

The hamburger might have remained on the seamier margins of American cuisine were it not for the vision of Edgar “Billy” Ingram and Walter Anderson, who opened their first White Castle restaurant in Kansas in 1921. Sheathed inside and out in gleaming porcelain and stainless steel, White Castle countered hamburger meat’s low reputation by becoming bastions of cleanliness, health and hygiene (Ingram even commissioned a medical school study to show the health benefits of hamburgers). His system, which included on-premise meat grinding, worked well, and was the inspiration for other national hamburger chains founded in the boom years after World War II: McDonald’s and In-N-Out Burger (both founded in 1948), Burger King (1954) and Wendy’s (1969).

Led by McDonald’s (and helped by the introduction abroad of U.S. hamburger culture by millions of members of the American armed services during World War II), the hamburger—and American-style franchised fast food—soon spread globally. By 2013 there were more than 18,000 McDonald’s restaurants worldwide.