Candy corn was created in the 1880s by the Wunderlee Candy Company and, by 1900, was being produced by the Goelitz Candy Company (now Jelly Belly), which has continuously produced it for more than a century. Candy corns get their name from the fact that they are shaped like a kernel of corn. Although they are often shown point-up, the yellow end is really the "top" of the corn. The design apparently made it popular with farmers when it first came out, but it was the fact that it had three colors - a really innovative idea - that catapulted it to popularity.
Originally, candy corn was made of sugar, corn syrup (not HFCS), fondant and marshmallow, among other things, and the hot mixture was poured into cornstarch molds, where it set up. This original mixture is probably where the name of the candy corn-like Mellocreme Pumpkins comes from. The recipe changed slightly over time and there are probably a few variations in recipes between candy companies, but the use of a mixture of sugar, corn syrup, gelatin and vanilla (as well as honey, in some brands) is the standard.
A serving of candy corn has about 22 pieces and contains 140 calories, no fat. While it is just about all sugar, the sweet can still be a better choice than a couple of mini candy bars or other Halloween treats that are high in both calories and in fat. Additionally, 22 pieces of candy corn will last a lot longer than one mini candy bar will.