The tribological behavior of hydrogenated amorphous carbon film (a-C:H) is known to be very sensitive to the external environment. In an N-2 environment, a-C: H can maintain long-term superlubricity. Currently, no convincing explanation is available for the mechanism through which N-2 significant decreases the friction coefficients. In this work, we explain the tribological behavior of a-C:H films by accounting for the internal electronic structure of ambient gas molecules, their atomic electronegativity, the surface bonding state of a-C:H, and the synergistic effects of these factors. Here, we proposed a mechanism based on the unique electronic structure of N-2 molecules. N-2 has two lone electron pairs, and its lone-pair electrons interact with surface C-H bonds of a-C:H, forming -C-H center dot center dot center dot:N equivalent to N: interactions that are similar to the hydrogen bonds in water. This causes N-2 to be adsorbed on the film's surface. As two surfaces approach each other, the other lone-pair electrons in N-2 become close, generating electrostatic repulsion and resulting in super-low friction. Based on the above analysis, we calculated the friction forces of a self-mated a-C:H film in different environments (vacuum, N-2, O-2) using density functional theory. These theoretical calculations matched experimental results, indicating that the proposed approach is reasonable.