Original: The reason for this is that their outmost electron shells (valence shells) are completely filled, so that they have little tendency to acquire or lose electrons.
Simplified: The inertness of nitrogen is due to the presence of the very strong triple covalent bond in the N2 molecule.