A gumball is fancy form of gum---a ball of gum coated with hard candy and often dispensed from a gumball machine. The gumball is the result of a combination of innovations, most of which were made in the 19th and 20th centuries.
According to most historians, the origin of gum can be traced as far back as ancient Greeks, who chewed resin from mastiche tree barks. The Mayans chewed on sap called "chicle" from the Sapodilla tree as early as the 3rd century A.D. The idea of gum spread widely when Native Americans introduced settlers to chewing resin from spruce trees.
During the 19th century, gum went though a relatively rapid evolution. By 1850, John B. Curtis was making and selling the first commercial chewing gum. He called it "The State of Maine Pure Spruce Gum." He was also responsible for the popularity of paraffin-based chewing gums trumping that of spruce-based ones. Thomas Adams patented a machine to manufacture gum in 1871, coupling that with his gum-developing efforts (1884's Adam's Black Jack) to become the first person to sell gum via a vending machine. His work would lead to the development of the first gums to have added flavor---by fellow entrepreneurs William Wrigley Jr. and Frank Henry Fleer. By the late 1890s, Wrigley would become synonymous with gum products.
The Gumball Invention
However, according to legend, the gumball was not invented until the start of the 20th century---interestingly enough, by an anonymous German grocer in New York. One day, irate that his gum---in flat, stubby form---was not selling, he wadded up a piece and flung it across the store. The wad of gum fell into a barrel of sugar, and the grocer then picked it up to admire its newly acquired glistening appearance.
The Gumball-Vending Machine Combo
The legend continues by claiming that the German grocer introduced it to a friend of his, from whom he borrowed a peanut vending machine and changed the mechanism to lend it the ability to dispense the new discovery. Truth or not, the gumball machine was already a popular device by the 1920s.
Walter Diemer (oddly enough, an accountant at the Fleer company), not only came up with the right combination of ingredients to make the gum elastic enough to blow into a bubble, but he also established the traditional gum color of pink by using the only hue available on the shelf when he was making his concoction. His 1928 creation, Dubble Bubble, became the first commercially successful bubblegum. It was at first sold in the form of gumballs with the name stamped on the candy coating and later as a small brick with a comic wrapper.
Today, gumballs---and the machines they are placed in---are ubiquitous, present everywhere from barbershops and dry cleaners to grocery stores and even some executive offices.