It’s a fairground treat that’s super sweet – but could the dentist’s nemesis have some useful secrets for medical science? BBC Future investigates.

Candyfloss – or cotton candy to Americans – is a singular sort of confection. The fluffy carnival treat is like nothing else edible. What else feels lighter than air in your hand and seems to evaporate once it gets past your lips, leaving only sweetness and red dye? When you're a kid – or sometimes an adult, let's be real – it ranks up there with astronaut ice cream in the hierarchy of fascinating treats.

Like astronaut ice cream, which has had its moisture removed in a vacuum chamber, candyfloss has some interesting chemistry behind it. And that chemistry may even have applications beyond dessert – some researchers are using candyfloss machines to help grow new tissues in the lab.

Candyfloss begins as solid sugar, which is poured into a little hopper with a heating element. Surrounding the mouth of the hopper is a ring pierced with minuscule holes; surrounding that is a big metal receptacle a lot like an oversized cake pan. As the heating element melts the sugar into a liquid, a motor sets the whole contraption spinning.

A fringe of liquid sugar, not even really visible to the naked eye in videos of the process, shoots out of the hopper onto the ring. There, it's flung by the force of the spin through the tiny holes, emerging onto the other side as a bunch of nearly invisible threads.

While the mass of sugar starts out molten, being split into so many little pieces gives it much greater surface area than before – much more of it is exposed to the cooler air – and so it goes from being liquid to being solid in an instant. The resulting sugar cobweb collects all around the inside of the big pan, and you can use a paper cone to lift it out and wrap it up into the familiar pouf.

Candyfloss machines make this process relatively simple, but long before they existed confectioners were still trying to get something like this to happen to sugar. One recipe in The Complete Housewife (1773) begins, “Take a quarter of a pound of treble refined sugar, in one lump, and set it before a moderate fire.” Once the sugar has liquefied in its dish and begins to “run clear like water”, you are instructed to dip a knifepoint in it and – quickly, quickly – draw out a long thin strand of sugar that you wrap swiftly about a mold. Then you return with the knife to pick up another strand, continuing as long as the sugar remains molten – hopefully long enough for you to get enough sugar threads wrapped around your mold to make a nice web or nest to put delicacies in.

The contraption described by the original patent is similar to the one used today

Luckily for those of us who do not possess such wells of patience and dexterity, in 1897 two Americans applied for a patent for a candyfloss machine. “To all whom it may concern,” begins their application, “be it known that we, William J Morrison and John C Wharton, citizens of the United States, residing at Nashville, in the county of Davidson and State of Tennessee, have invented certain new and useful Improvements in Candy-Machines... in which a revolvable or rotating pan or vessel containing candy or melted sugar causes the said candy or melted sugar to form into masses of thread-like or silk-like filaments by the centrifugal force due to the rotation of the vessel.”

Deadly dull descriptions notwithstanding, the thing was a hit. At the 1904 World's Fair in St Louis, Morrison, who happened, ironically, to be a dentist, and Wharton sold spun sugar to all comers. According to a lovely and authoritative Gourmet article by Bruce Feiler, they sold a whopping 68,655 boxes. (Sweet-toothed readers take note: Another confection to have its world debut at the fair was the waffle cone.) Improvements to the machine eventually followed – apparently it had a problem with vibration – but the contraption described by the original patent is similar to the one used today.

And it just so happens that this method of making a solid web from a liquid material has potential medical applications: Scientists at Vanderbilt University (also, by coincidence, in Nashville) are using a candyfloss machine to help build scaffolds for growing cells in, as part of an effort to create artificial tissues.

One trouble with the gels currently used by scientists studying this is that they aren't always as porous as one would like, so cells can't populate them completely. The Vanderbilt team used their machine to spin a cloud of polymers, embedded them in a gel, and then caused them to dissolve, leaving behind an intricate network of vessels. Ninety percent of the cells encouraged to take up residence in this structure were alive a week later, compared to 60-70% of those in gels without vessels.

So, as you enjoy the lovely puff of sugar made molten and then solid again in the blink of an eye, think of the housewives of old who used to have to make it with a knife and the men who made it possible for everyone to have it—and the possibility that the same method might someday help us grow new tissues.

Join 600,000+ Future fans by liking us on Facebook, or follow us on Twitter, Google+, LinkedIn and Instagram

If you liked this story, sign up for the weekly features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.