Clouds should have been the obvious choice. But for the source of cotton candy, my 4-year-old self looked into the dark corner of a gym beyond the bleachers and royal blue tumbling mats, where I spotted a wad of light gray fluff. I crammed a fistful of the billowy stuff in my mouth and learned that it was not sweet, would not melt and, as explained by my gym teacher, was actually a dirty thing that went by the deceivingly cute name dust bunny.

Decades later, I still was unsure of the origins of cotton candy (though acutely aware that it doesn’t occur naturally). So in preparation for the cotton candy seasonwhen one vendor churns through 1,400 pounds of pink sugar during the 11-day North Carolina State FairI settled in at the library to find its roots.

The details resided in the Journal of the History of Dentistry, which reports that in 1897, William James Morrison, former President of the Tennessee State Dental Association, co-created a machine capable of producing cottony strands of crystallized sugar. (The dentist with a law degree also penned several children’s books and made a substitute for lard out of cottonseed oil.)

But Morrison didn’t pull the treat out of thin air. Cotton candy has a predecessor in spun sugar, which was popular in 15th-century Italy. To create that delicacy, caramelized crystals were whisked from the ends of forks or prongs. The resulting spindly candy threads were often sculpted into figurines that were used to decorate a table, or in one case, even become a table. France’s Henri III was famously served from a banquet in Venice where all 1,286 piecesfrom the plates to the tableclothwere created from spun sugar.

The decadent treat became more widespread when the high price of sugar dropped around 1830. And by the late 1800s, several cookbooks provided step-by-step instructions, along with inspiration. As explained in A Treatise on the Art of Boiling Sugar from London in 1884, “Spun sugar can also be made into vases, ships, etc. by making the parts separate and afterwards sticking them together with some of the sugar used in the process.” It was “the most difficult and the most interesting of the confectioner’s art.”

Then came the candy machine, which spun an unkempt puff of sugar. Submitted for patent in 1897 by Morrison and John C. Wharton, a candymaker in Nashville, Tenn., the device featured a rotating plate that was powered by foot and heated by coal or oil lamp. Using centrifugal force, it released crystallized sugar from the hot plate through a number of small holes to form “masses of thread-like or silk-like filaments.”

“The object of our invention is to obtain an edible product consisting of the said filaments of melted and ‘spun’ sugar or candy,” the patent application read.

The result was Fairy Flossan apt name for the dentist’s thread-like candy. Produced in an updated electric candy machine, the treat debuted in 1904 alongside Dr. Pepper, Cracker Jack and ice cream cones at the Louisiana Purchase Exposition, known more widely as the St. Louis World’s Fair. There, Morrison and Wharton sold their product in colorful wooden boxes for 25 cents apiece, which was half the cost of admission to the fair.

But the price didn’t hinder their business. During the festival, they sold 68,655 servings, worth $17,163.75.

Since Fairy Floss floated into the market in 1904, little about it has changed. In the 1920s, the name cotton candy caught on (in other countries, Papa’s Beard, Candy Feathers, Pinkie Floss and Breeze Cotton are among the appellations), but the recipe is still the same: sugar, often with a bit of coloring. And cotton candy machines still operate true to Morrison and Wharton’s design.

Aspects of my cotton candy habits have remained consistent, too. Last Friday at the State Fair, I wandered again toward a dimly lit corner, this time in the Commercial building at the fairgrounds. But the light brown fluff I found there was exactly what I wanted: maple syrup cotton candy by MacLeod Farms of Barre, Vt. It contains a sweet, earthy undertone the common blue and pink varieties of cotton candy lack.

I bought a bag for $4, which amounted to half the price of my $8 ticket to the fair. But I felt about it like the folks in St. Louis must have: It was worth every cent.

This article appeared in print with the headline “Pour some sugar on me.”