It happens when you pile fresh coal on top of a nice glowing bed .... now the flame goes out, but the fresh coal starts heating up & releasing flammable gasses. Sometimes just the pressure of shutting the ash door will force a tiny flame through a corner of the bed of coal ...... and since you just had the ash door open, you now have a perfect air/fuel mixture .... essentially, you've created an engine with no piston!
This is completely preventable. Little bit of coal at a time, or banking the coal ... or opening both the ash & loading doors at the same time until you get flame, then close ash door first, followed by loading door ..... if there is no flame, the potential for a puff is high. If you have flames, no chance at all.