Empirical evidence (a, b) that support the proposed conceptual model (c). At high environmental heterogeneity, community structure is mainly determined by heterogeneous selection. The heterogeneous selection promotes greater β-diversity increasing divergence in local communities, and higher interconnected bacterial co-occurrence network. At intermediate values of environmental heterogeneity both heterogeneous and homogeneous selection act with similar strength, and stochastic processes reach more importance. In this scenario, the selection acting in opposite ways does not allow homogenization or differentiation of local community structure, leading to an overall reduction of turnover and β-diversity. Simultaneously, the metacommunity will have a relatively high randomness due to intermediate dispersal rates. As a consequence, the association network would tend to be loosely interconnected. In extremely homogeneous environmental conditions, the low diversity of niche habitats leads to an increase of homogeneous selection, and local communities are strongly filtered by common environmental factors. Homogeneous selection then leads to a low turnover and β-diversity, promoting less interconnected associations. ND network density.