The short answer is that it came from Hamburg, Germany. And that is just plain weird when you think about it, because the frankfurter (a.k.a. the hot dog) came from Frankfurt, Germany (see What are hot dogs made of? for details). One can only imagine why French Fries beat out German Fries...
Hamburger started with the Tatars (or Tartars), a nomadic people who invaded central Asia and eastern Europe in the Middle Ages. The Tatars ate their shredded beef raw (hence the name "steak tartare" these days). According to one account, they tenderized their beef by putting it between the saddle and the horse as they rode. When the Tatars introduced the food to Germany, the beef was mixed with local spices and fried or broiled and became known as Hamburg steak. German emigrants to the United States brought Hamburg steak with them. It showed up on New York restaurant menus in the 1880s. Hamburgers became a sensation as sandwiches at the 1904 World's Fair in St. Louis.
White Castle, founded in 1921 in Wichita, Kan., is the world's oldest chain of hamburger restaurants. The hamburger's popularity exploded in the United States after World War II when burgers became the main menu item at drive-in restaurants spawned by the growing number of cars. McDonald's, which started as a hamburger stand in San Bernardino, Calif., has spread the hamburger around the world. The world's largest restaurant chain with more than 26,000 restaurants in 119 countries has served billions of hamburgers.
Here are some interesting links: