Trick candles have a material added to the wick that is capable of being ignited by the relatively low temperature of the hot wick ember. When a trick candle is blown out, the wick ember ignites this material, which burns hot enough to ignite the paraffin vapor of the candle. The flame you see in a candle is burning paraffin vapor.
What substance is added to the wick of a magic candle? It's usually fine flakes of the metal magnesium. It doesn't take too much heat to make magesium ignite (800° F or 430° C), but the magnesium itself burns white-hot and readily ignites the paraffin vapor. When a trick candle is blown out, the burning magnesium particles appear as tiny sparks in the wick. When the 'magic' works, one of these sparks ignites the paraffin vapor and the candle starts to burn normally again. The magnesium in the rest of the wick doesn't burn because the liquid paraffin isolates it from oxygen and keeps it cool.