Abstract
Identifying the mechanisms that generate structure in complex ecological communities is fundamental for understanding their assembly. Yet a comprehensive picture of how ecology and evolution combine to generate these patterns remains limited. We use an eco-evolutionary model of community assembly that incorporates interaction-driven population dynamics and evolutionary processes, including speciation and inheritance of interactions, to unveil the mechanisms generating and maintaining biodiversity in complex species interaction networks. Importantly, our model unpicks the effects of selection of interaction types from those of inheritance by comparing evolutionary assembly with invasion-based assembly under different combinations of interaction types. We find that a cost-benefit balance in accumulating interactions separates communities into two distinct types. Weakly beneficial interactions produce sparse, competition-dominated networks, whereas strongly beneficial interactions generate highly mutualistic, more connected communities. Mutualism, driven by both selection and inheritance, facilitates the emergence of large communities with increased complexity. Comparing model results with empirical patterns from microbial communities, we identify potential drivers of ecosystem assembly and characteristic interaction structures. Our results provide a classification system of complex ecosystems based on their composition of ecological interactions, thus generating testable hypotheses on the conditions under which different community types (mutualistic vs. competitive) might emerge.