Nitrogen is found in large amounts in fertilizer. One simple example of a nitrogen-containing explosive is nitrogen triiodide (NI3). Nitrogen triiodide, like many explosives, forms N2 gas upon detonation:
2 NI3 (s) –> 3 I2 (g) + N2 (g)
The formation of N2 (g) releases almost a megajoule per mole. This energy release upon the formation of N2 (g) is the reason why nitrogen is a common component in explosives.