I did the experiment to qualitatively observe the different colours given off by different salts when placed in a flame.

But what is actually happening to the salt ?

Take $\ce {KCl}$ for example.

Does the $\ce{ KCl}$ react with $\ce {O2}$ ?

What does the reaction equation look like ?

Other salts include $\ce {LiCl}, \ce{BaCl2}$, $\ce{SrCl2}$, $\ce{CuCl2}$ and $\ce {NaCl}$.