Carbon nanotubes (CNTs), hollow cylinders of carbon1 with diameters in the nanometer range, hold great promise for advanced technologies2–5, provided their structure is controlled and remains uniform throughout their length6–9. Their growth, facilitated by a metal catalyst, takes place at high temperatures across a tube-catalyst interface comprising a few tens of carbon atoms. During growth, the structure, and properties of CNTs are defined but defects can alter them10. These defects are believed to form and heal at the tube-catalyst interface although an understanding of these mechanisms at the atomic-level is still lacking11, 12. Here, using molecular dynamics simulations driven by a machine learning force field13 (MLFF) we developed, DeepCNT-22, we unveil the mechanisms of CNT formation from nucleation to growth including defect formation and healing. We find the tube-catalyst interface to be highly dynamic during growth, with large fluctuations in the chiral structure of the CNT-edge. This contradicts the previous notion of a continuous spiral growth mode14, but confirms that the growing tube edge exhibits significant configurational entropy15. We demonstrate that defects form stochastically at the tube-catalyst interface, however, under low growth rates and high temperatures, healing becomes more efficient than formation, allowing CNTs to grow defect-free to seemingly unlimited lengths. These insights, not readily available via experiments, demonstrate the remarkable power of MLFF-driven simulations and fill long-standing gaps in our understanding of CNT growth mechanisms.