Nitrogen triiodide (NI3) is an unstable, explosive compound, which constitutes of one nitrogen atom bound to three iodine atoms. It is a covalent compound of nitrogen analogous to ammonia (NH3). Pure NI3 decomposes at 0 C, so it cannot exist in standard conditions, but it can exist if coordinated as an ammine complex. (NI3 . (1,3,5)NH3) is a red-black crystalline solid. It is stable in aqueous solution, but when dry, it detonates literally because of a touch of a feather.

There are a lot on unstable explosives, but nitrogen triiodide has everything against its stability. First, NI3 is a nitrogen explosive. The N-N bond in elemental nitrogen (N2) has a large bond enthalpy: -945 kJ mol-1. That is, when nitrogen molecules are created, a lot of energy is released. Analogous compounds, like ammonia (Hf = -43 kJ mol-1), need energy for decomposition. Not so with nitrogen triiodide: its decomposition actually releases energy. (Hf = +192 kJ mol-1.)

Not only thermodynamics make the molecule unstable. The molecule is barely holding together. The iodine atoms are larger than the nitrogen atom, so the oppositely-charged(1 iodines are forced close together. It's easy to tear them off from the nitrogen.

If you look at the reaction and still ask why would it be explosive, look at the phases: a solid decomposes completely into gases. This causes a rapid and large increase of volume. When this is combined with just-look-at-it-wrong activation energy and the infernal release of energy, there'll be a sonic boom, which goes through the crystal and detonates the NI3 into elements.

Decomposition is violent, produces a loud report and releases elemental nitrogen and toxic gaseous iodine, which leaves permanent stains and can damage lungs.

2NI3(s) -> N2(g) + 3I2(g)

This reaction is used frequently as a demonstration with everything carefully prepared and safe. There's better application: synthesize some NI3, VERY carefully place one crystal (1-2 mm) on a piece of tape, lay another piece on it to protect the crystal and leave these "anti-personnel mines" in places where they will be stepped on. Someone will discover how nitrogen triiodide decomposes... It'd be plain stupid to use any larger amounts than one crystal for this prank.

Pure NI3 is difficult to make and the way to synthesize it was discovered as late as in 1990. The conditions are unusual: at -30 C, boron nitride and iodine monofluoride react in an chloroform (CH3Cl) solution to produce boron fluoride and nitrogen triiodide. As mentioned before, pure NI3 decomposes at 0 C.

BN + 3IF -> NI3 + BF3

Impure NI3 (ammine complex) is easy to synthesize from iodine and excessive aqueous ammonia. The iodine and the ammonia must be pure enough to achieve this. Iodine can be purified by evaporating it off from the impure mixture and then condensing. The products are an triiodide-ammonia complex and hydroiodic acid. It is impossible to remove the ammonia from the resulting complex.

2NH3 + 3I2 -> NI3 . NH3 + 3HI
4NH3 + 3I2 -> NI3 . 3NH3 + 3HI
6NH3 + 3I2 -> NI3 . 5NH3 + 3HI

1) Partial charges due to electronegativity, not full electron charge units.

Sources: Cotton, Simon. Nitrogen Tri-iodide. URL: http://www.chm.bris.ac.uk/motm/ni3/ni3c.htm
chem, sci. sci.chem FAQ.