Hold a metal kitchen sieve in a candle flame. To your surprise the flame only reaches the wire net, but does not go through it.
The metal in the sieve conducts so much heat away that the candle wax vapour cannot ignite above the wire net. The flame only passes through the metal lattice if it is made to glow by strong heating.
Theminer’s safety lamp works in the same way.A metall attice surrounding the naked flame takes up so much heat that the gases in the mine cannot ignite.