The short answer is that they have magnesium incorporated into the wick. For a flame to exist, it needs oxygen, fuel and enough heat to keep combustion going once it starts. These requirements are sometimes represented graphically as the three sides of a ’fire triangle’.
How do regular Candles Work?
Candles really are an amazing lighting system -- the fuel itself is the package. There are two parts that work together in a candle:
The fuel, made of some sort of wax
The wick, made of some sort of absorbent twine
The wick needs to be naturally absorbent, like a towel, or it needs to have a strong capillary action (as in glass fiber wicks used in oil lamps). If you buy a length of un-waxed wick at a craft store and play with it, you will find that it feels like soft string and absorbs water very well. This absorbency is important in a candle because the wick needs to absorb liquid wax and move it upward while the candle is burning.
Trick Candles
When you blow out an ordinary candle, you extinguish the flame by removing heat. You can still see the fuel —- the wax smoke, often paraffin vapour — coming from the wick, but the ember in the wick does not supply enough heat to reignite it, and so it will eventually go out. But when the wick has magnesium powder in it, the ember is able to ignite the magnesium. This element catches fire at relatively low temperatures, below 500 °C, and this is enough to reignite the smoky fuel. The flame itself then burns at around 3000 °C.
If you look closely at one of these candles after you have apparently blown it out, you can see the smouldering wick emitting little sparks of burning magnesium before the candle relights.