A fundamental mechanism for carbon-film lubricity identified by means of ab initio molecular dynamics