We study the deposition of tetrahedral amorphous carbon (ta-C) films from molecular dynamics simulations based on a machine-learned interatomic potential trained from density-functional theory data. For the first time, the high sp3 fractions in excess of 85% observed experimentally are reproduced by means of computational simulation, and the deposition energy dependence of the film's characteristics is also accurately described. High confidence in the potential and direct access to the atomic interactions allow us to infer the microscopic growth mechanism in this material. While the widespread view is that ta-C grows by "subplantation," we show that the so-called "peening" model is actually the dominant mechanism responsible for the high sp3 content. We show that pressure waves lead to bond rearrangement away from the impact site of the incident ion, and high sp3 fractions arise from a delicate balance of transitions between three- and fourfold coordinated carbon atoms. These results open the door for a microscopic understanding of carbon nanostructure formation with an unprecedented level of predictive power.