Tribological interfaces between silicon-based ceramics, such as Si3N4 or SiC, are characterized by high friction and wear in unlubricated conditions. A solution to this problem is to use them in combination with a hydrogenated amorphous carbon (a-C:H) countersurface from which a passivating carbon film is transferred onto the ceramic surface. However, the mechanisms underlying a stable film transfer process and the conditions that favor it remain elusive. Here, we present friction experiments in ultrahigh vacuum in which friction coefficients lower than 0.01 are achieved by sliding Si3N4 against a-C:H with 36 at. % hydrogen but not against a-C:H with 20 at. % hydrogen. Chemical surface analyses confirm that the superlubric interface forms via the transfer of a hydrocarbon nanofilm onto the Si3N4 surface. Quantum-mechanical simulations reveal that a stable passivating a-C:H film can only be transferred if, after initial cold welding of the tribological interface, the plastic shear deformation is localized within the a-C:H coating. This occurs if the yield shear stress for plastic flow of a-C:H is lower than that of the ceramic and of the shear strength of the a-C:H-ceramic interface, i.e., if the a-C:H hydrogen content ranges between ∼30 and ∼50 at. %. While the importance of a relatively high hydrogen content to achieve an efficient passivation of a-C:H surfaces in a vacuum is well-documented, this work reveals how the hydrogen content is also crucial for obtaining a stable a-C:H transfer film. These results can be extended to glass, SiC, and steel, supporting the generality of the proposed mechanism.