Zelezniak et al. developed a modelling approach termed 'species metabolic interaction analysis' (SMETANA) that maps all possible interspecies metabolic exchanges according to the genomic potential encoded by all species present in microbial communities. They analysed more than 800 communities in soil, water and human gut samples, and identified co-ocurring subcommunities, which are groups of species found together within different samples. Their analysis revealed that the species present in the communities display increased resource competition compared with random microbial assemblies, suggesting that resource availability in different habitats shapes the overall composition of the community. By contrast, the species present in the smaller subcommunities have a high degree of dependency on exchanged metabolites, particularly amino acids and sugars. These data highlight how the interplay between competitive and cooperative strategies shapes the composition of complex microbial communities.