Phosphorus is highly inflammable; in a matchstick, it ignites by
It starts burning.
When you strike the stick against the striking surface, the friction hence generated causes some of the red phosphorus present to turn into white phosphorus. It ignites spontaneously in the air. Thus, we can say that in a matchstick, phosphorus ignites by heat energy generated by friction.