|MadSci Network: Chemistry|
The chemical you were watching was Potassium Chlorate (KClO3). Potassium chlorate has many charming features including helping things containing sugar to burst into flame.
Here's what's happening:
Potassium Chlorate is an oxidizer. One way to think about an oxidizer is to look at the word. Oxidation can mean that it adds oxygen to a reaction. This is not the only or even best definition for an oxidizer, but I'll use it to illustrate my point here. In order to make something burn, you need three ingredients: stuff that burns (a fuel), heat, and oxygen to help it. The potassium chlorate, when it is placed on the sugary candy, begins chemically changing the sugar in the candy. When this happens, a lot of heat is produced. Now we have two of our three ingredients to make a fire happen: sugar (our fuel) and heat (from the reaction of the potassium chlorate and sugar). Now, many reactions in nature produce heat, but will not cause a fire. One reason is that not enough oxygen is available to make the fire happen. Another feature of Potassium Chlorate is that when it reacts with other substances, it provides a lot of oxygen for the reaction (remember the "oxidizer" part?). If there is already heat and fuel available, then you have created a fire.
Potassium chlorate can actually be a fairly dangerous compound to have around; it has been known to "spontaneously" combust, and other nasty reactions can happen with it if you are not careful.
Many science teachers who do a similar experiment to the one you were shown use acid to "spark" the reaction, I imagine that is what happened in your reaction also. The acid (normally sulfuric acid (H2SO4)) reacts with the potassium chlorate to produce a flammable gas (chloric acid as a gas). This helps get the reaction started, normally very slowly leading up to an exciting finish.
Take Care and Be Safe,
Steve E. Williams
Rock Star and Science Demonstrator
Pacific Science Center, Seattle, Washington
Try the links in the MadSci Library for more information on Chemistry.