Plants compete with their neighbours for limiting resources such as light and nitrogen, which can promote competitive ability at the expense of other functions such as chemical defence against insect herbivory. This trade-off is strongly influenced by dynamic interactions with biotic and abiotic factors. Yet, understanding how these interactions influence the balance between growth and defence remains one of the key challenges in the field of plant evolutionary ecology. In this study, we investigated how resource availability, competition pressure and insect herbivore pressure drive selection on the balance between the acquisition and protection of resources. To this end, we developed a novel simulation model that combines a functional-structural plant (FSP) model of plant growth in a 3D light climate with a model of natural selection. This mechanistic modelling approach simulates plant growth, competition for above- and below-ground resources, and natural selection to investigate selection pressures on traits related to growth and defence as imposed by different levels of plant density, nitrogen availability and herbivory. The model presented in this study was able to recreate the functional equilibria predicted by principal ecological theories on the effects of resource availability and resource-driven trade-offs. This illustrates the potential of mechanistic modelling approaches such as the one presented here for future research on plant responses to dynamic and variable environments. Our results further showed a three-way interaction between plant competition for light, competition for nitrogen and herbivory that determined the optimal balance between the acquisition and protection of resources. This shows that the value of investing in the acquisition or the protection of resources is a dynamic problem that is influenced by multiple ecological interactions, trade-offs and tragedies of the commons, and therefore requires an eco-evolutionary context to be fully understood.