Or protected from the flame ignited within the enclosure to reach the outside where there is way more of gas. (Filling the box with sand often can do the job; the flame that has to pass through the layer with a lot of cold surface will get cooled below the temperature where the burning can be self-sustaining.)