A better understanding of microbial dynamics in porous media may lead to improvements in the design and management of a number of technological applications, ranging from the degradation of contaminants to the optimization of agricultural systems. To this aim, there is a recognized need for predicting the proliferation of soil microbial biomass (often organized in biofilms) under different environments and stresses. We present a general multi-compartment model to account for physiological responses that have been extensively reported in the literature. The model is used as an explorative tool to elucidate the ecological and soil hydraulic consequences of microbial responses, including the production of extracellular polymeric substances (EPS), the induction of cells into dormancy, and the allocation and reuse of resources between biofilm compartments. The mechanistic model is equipped with indicators allowing the microorganisms to monitor environmental and biological factors and react according to the current stress pressures. The feedbacks of biofilm accumulation on the soil water retention are also described. Model runs simulating different degrees of substrate and water shortage show that adaptive responses to the intensity and type of stress provide a clear benefit to microbial colonies. Results also demonstrate that the model may effectively predict qualitative patterns in microbial dynamics supported by empirical evidence, thereby improving our understanding of the effects of pore-scale physiological mechanisms on the soil macroscale phenomena.