The confined and crowded environment of developing brains imposes spatial constraints on neuronal cells that have evolved individual and collective strategies to optimize their growth. These include organizing neurons into populations extending their axons to common target territories. How individual axons interact with each other within such populations to optimize innervation is currently unclear and difficult to analyze experimentally in vivo. Here, we developed a stochastic model of 3D axon growth that takes into account spatial environmental constraints, physical interactions between neighboring axons, and branch formation. This general, predictive and robust model, when fed with parameters estimated on real neurons from the Drosophila brain, enabled the study of the mechanistic principles underlying the growth of axonal populations. First, it provided a novel explanation for the diversity of growth and branching patterns observed in vivo within populations of genetically identical neurons. Second, it uncovered that axon branching could be a strategy optimizing the overall growth of axons competing with others in contexts of high axonal density. The flexibility of this framework will make it possible to investigate the rules underlying axon growth and regeneration in the context of various neuronal populations.