Metagenomics has revealed hundreds of bacterial species in almost all microbiota. In a few well-studied cases, bacterial communities have been observed to coordinate their metabolic fluxes. In principle, bacteria can divide tasks to reap the benefits of specialization, as in human economies. However, the benefits and stability of an economy of bacterial specialists are far from obvious. Here, we physically model the population dynamics of bacteria that compete for steadily supplied resources. Importantly, we explicitly model the metabolic fluxes yielding cellular biomass production under the constraint of a limited enzyme budget. We find that population dynamics generally leads to the coexistence of different metabolic types. We establish that these bacterial consortia act as cartels, whereby population dynamics pins down resource concentrations at values for which no other strategy can invade. Finally, we propose that at steady supply, cartels of competing strategies automatically yield maximum biomass, thereby achieving a collective optimum.