Metabolic division of labor (MDOL) is widespread in nature, whereby a complex metabolic pathway is shared between different strains within a community for mutual benefit. However, little is known about how communities engaged in MDOL assemble and spatially organize. We hypothesized that when degradation of an organic compound is carried out via MDOL, substrate concentration and its toxicity modulate the benefit allocation between the two microbial populations, thus governing the assembly of this community. We tested this hypothesis by combining individual-based simulations with pattern formation assays using a synthetic microbial community. We found that while the frequency of the first population increases with an increase in substrate concentration, this increase is capped with an upper bound determined by the biotoxicity of the substrate. In addition, our model showed that substrate concentration and its toxicity affect levels of intermixing between strains. These predictions were quantitatively verified using an engineered system composed of two strains degrading salicylate through MDOL. Our results demonstrate that the structure of the microbial communities can be quantitatively predicted from simple environmental factors, such as substrate concentration and its toxicity, which provides novel perspectives on understanding the assembly of natural communities, as well as insights into how to manage artificial microbial systems.