I'm not entirely sure if this is the right place for this question, but I decided that it's better than physics.se (and I had no other ideas). I hope this is a good match, otherwise please move the question where it would belong. :)
I often use a mildly scented tealight in my apartment to cover the lingering smell of food. I usually light them using a matchstick, and sometimes I would toss the matchsticks into the tealight after lighting it up.
Usually, the matchstick would burn out after a short while, and for most of the life of the tealight nothing interesting happens. However, when the tealight is very close to burning out with the remains of the matchstick inside, it starts burning very violently, with the flame forming fantastic shapes (it looks like the whole remaining volume of the wax is burning).
Once the flame was so violent it broke the heat resistant glass container I kept it in (I was careless and I let the side of the cup touch a thinner part of the glass, rather than just the bottom).
Why does this happen?