When the nitrogen-nitrogen triple bonds form Huge amount of energy is released.
Energy release in the formation of one triple bond is much more than the breaking energy of three single bonds that bind the nitrogen in the starting compound
In other words, breaking three weaker bonds and making one very strong bond takes place.