Coal mines are dangerous because of flammable gasses like methane that can accumulate (gather together). A lamp with a naked (exposed) flame might make these flammable gasses catch fire, causing an explosion, which could kill people. The safety lamp prevents the hot flame of the lamp touching the flammable gasses, reducing the chance of an explosion.