There are two major classes of incidents resulting in explosions:
In the first case, the explosion happens by the mechanism of shock to detonation transition. The initiation happens by an explosive charge going off in the mass, by the detonation of a shell thrown into the mass, or by detonation of an explosive mixture in contact with the mass. The examples are Kriewald, Morgan, Oppau, Tessenderlo and Traskwood.
In the second case, the explosion results from a fire that spreads into the ammonium nitrate (AN) itself (Texas City, Brest), or to a mixture of an ammonium nitrate with a combustible material during the fire. The fire must be confined at least to a degree for successful transition from a fire to an explosion (a phenomenon known as "deflagration to detonation transition", or DDT). Pure, compact AN is stable and very difficult to initiate. However, there are numerous cases when even impure AN did not explode in a fire.