(a) Microbiome stability is a function of the community’s ability to recover its original functions following a disturbance. Functions could include the production of specific molecules over time. (b) Microbiome composition and function are shaped by multiple spatial and temporal factors. (i) At the broadest scale, availability of carbon and energy defines possible ecological niches within each environment. (ii) Within a community, interspecies interactions, including social behaviors, modulate how cells respond to their environment by modifying substrate availability (i.e., syntrophy or competition), releasing effectors, or occupying available space. Biofilms, in particular, provide resilience to specific environmental perturbations. (iii) Within each cell, function is constrained by individual metabolic capacity, which can be altered through genetic mutations or horizontal gene transfer. Membrane-bound proteins transduce signals and molecules from the environment to the cytosol as well as facilitate secretion of products from the cell to the environment. Figure adapted from images created with BioRender.com.