A dust explosion generally occurs when the air in a factory or other confined space is full of dust particles that somehow come into contact with a flame or spark. This will ignite the dust, which can burst into flame very rapidly. All this rapid burning generally causes an explosive effect, and this can potentially be powerful enough to cause buildings to burst apart and easily injure or kill people. There is also a phenomenon where the vibrations from a dust explosion cause more dust to enter the air and immediately trigger a series of explosions.
Dust explosions used to be more common before the era of strict factory regulation. In those times, dust was a very common cause of explosions and worker deaths. Many countries now have safety regulations for factories that lessen the chance of a dust explosion, but they still happen occasionally.
Many different kinds of dust can lead to a dust explosion, including everything from food particles to certain kinds of metallic dust. Some things that don't have a reputation for burning easily can explode in dust form. For example, it would generally be unusual for a piece of bread to catch on fire, but grain dust is a very common cause of dust explosions, and granaries often have to be very careful about avoiding dust in the air.
Several things have to come together to cause a dust explosion, and if any of these factors aren't exactly perfect, the explosion usually won't happen. The first requirement is a high concentration of flammable dust—secondly, all that dust generally needs to be in a closed-up space. Thirdly, there needs to be a flame that's strong enough to get the dust started. All these ingredients are relative, and the exact amount of each required will vary. For example, if the dust is extremely flammable, then it may not need as much concentration or fire to start an explosion.
Factories have implemented several techniques to avoid dust explosion. For example, some companies set up fans to blow air out of buildings and keep dust from accumulating indoors. There's also usually a focus on avoiding an accumulation of dust in the air. Sometimes companies do this by changing the way their machinery works or increasing the humidity in the working environment. There are also usually strict rules to keep any ignition from happening in a potentially dangerous environment.