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 sp^{3} 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 sp^{3} content. We show that pressure waves lead to bond rearrangement away from the impact site of the incident ion, and high sp^{3} 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.This research was financially supported by the Academy of Finland through Grants No. 310574 and No. 285526. Computational resources were provided by CSC—IT Center for Science, Finland, though Projects No. 2000634 and No. 2000300. V. L. D. gratefully acknowledges a fellowship from the Alexander von Humboldt Foundation, a Leverhulme Early Career Fellowship, and support from the Isaac Newton Trust