October 30 marks National Candy Corn Day: a guilt-free excuse to indulge in this autumnal candy before trick-or-treating begins. But, the success of this century-old candy may have been inspired by something Americans weren’t actually too keen on chowing down on—hard, coarse field corn.

Candy corn first appeared around the turn of the 20th century, but it's hard to pin down who first molded and sold it, though history points to George Renninger, a Philadelphia confectioner, as the likely creator. The candy maker created a butter cream concoction in 1888 that was soft enough for shaping into a variety of figures, like turnips and pea pods (we’re sensing a theme here). The recipe was simple: sugar, corn syrup and wax. The Wunderle Candy Company, with Renninger’s recipe, produced the candies in several designs, including the iconic corn shape.

By 1898 another candy company was snagging most of the credit for candy corn. The Goelitz Candy Company formulated its own version of the treat that became widely popular. Owner Gustav Goelitz had been operating his Belleville, Illinois-based confectionery for nearly 30 years before passing on the company to his sons in 1894. Within four years, the company was creating its own butter cream candies, and advertised its candy as Chicken Feed—"something worth crowing for."

The Goelitz family was successful with its candy corn version, and would later go on to become the Jelly Belly Candy Company, which still produces the treat each year. Wunderle Candy Company would fade into confectionery history.

But what likely made candy corn such a successful treat was real corn. Modern diets and foods are heavily reliant on corn and corn byproducts, but early Americans didn’t consume as much as we do now. Why? Because 19th century corn wasn’t enjoyable to eat as it came out of the field. The common hybrid and sweet corns we eat now, which are softer and more flavorful, weren’t popular or widely available prior to World War I. And, corn had to be picked by hand at the time because mechanical corn harvesters and shuckers weren’t common, making a dinner side dish of corn on the cob a bit of a task.

But the familiar kernel shape, along with sweetness, made candy corn a standout. It was a novelty treat, since real corn kernels were in many cases reserved for livestock (hence the name “Chicken Feed”).

Regardless of who invented candy corn and how well it was liked, it wasn’t easy for any company to make. Renninger’s candy design, and those that followed, were hand-poured to achieve their tri-color appearance. The process involved factory workers called “runners” who would walk backward alongside conveyor belts loaded with trays, carrying heavy buckets called “streamers” filled with the slurry mixture. Runners would pass the streamers, which could weigh up to 200 pounds, over the molds, and small amounts of hot, liquid candy would drip into the trays. Each layer of dyed candy (white, yellow and orange) would be added separately, meaning candy makers would repeat the process three times before letting the candy cool and set. Because candy corn was such a taxing product to create, confectioners only produced it between March and November, helping it to become associated with Halloween and harvest time.

Now, modern candy corn production is a bit easier, with machines filling cornstarch molds instead of actual runners doing all the work. About 9 billion pieces of candy corn are produced each year, so don’t feel bad for having a few extra handfuls—and think of these tiny kernels as an ode to America’s agrarian roots.