Safety matches are ‘safe’ because they don’t just burn, you have to strike them against a special surface in order to get them to ignite.
The match heads contain sulfur (sometimes antimony III sulfide) and oxidizing agents (usually potassium chlorate), with powdered glass, colorants, fillers, and a binder made of glue and starch.
The striking surface consists of powdered glass or silica (sand), red phosphorus, binder, and filler.
When you strike a safety match, the glass-on-glass friction generates heat, converting a small amount of red phosphorus to white phosphorus vapor. White phosphorus spontaneously ignites, decomposing potassium chlorate and liberating oxygen. At this point, the sulfur starts to burn, which ignites the wood of the match.