The nitrogen is used to purge the surface of the metalic part that is heat treated. It prevents oxidation of the metal.
Carbonizing is another application were nitrogen is frequently used because of the need for an oxygen free atmosphere during the carbonization process.
In plastic injection molding nitrogen is often used as the assist gas that prevents oxidation of the plastic, that leaves the mold with a clean surface finish. Nitrogen is also injected with the plastic creating air channels which results in less plastic needed without cutting the strength.