Explosions are just reactions that happen very fast and produce a lot of heat. Flour mills grind flour to a very fine dust to make bread. Flour dust is very fine so the particles have a large surface area to volume ratio and can be ignited quite easily, often with explosive force.
Explosions in flour mills used to be quite common. This is a cornflour ‘bomb’. DO NOT TRY THIS AT HOME UNDER ANY CIRCUMSTANCES. IT IS A SCHOOL DEMONSTRATION WHICH MUST BE DONE OUTSIDE OR UNDER VERY CONTROLLED CONDITIONS. The cornflour is ignited by puffing it into the sealed coffee jar as shown. The reaction is very fast and exothermic, blowing the lid rather spectacularly off the jar.
Many people over the centuries have died underground from fires in mines. Coal dust is rather like flour in that it is very fine. In the early days, miners used explosives like dynamite or gunpowder to blast new rockfaces down the mine, resulting in the combustion of the fine carbon-rich particles of coal and the methane (or firedamp) found as a natural by-product of coal with appalling loss of life – again because of the great speed of the reaction. Low flame and low temperature explosives causing maximum blast but minimum risk of secondary ignition are enforced by law in modern mines. There are still a lot of places in the world where there aren’t any laws so the risks are very high. Here’s a picture from the Farmington mine disaster in 1968 in West Virginia USA. 78 people died.