In recent years, tissue-resident memory T cells (TRM) have emerged as essential components of immunological memory. Following antigenic challenge, TRM remain in nonlymphoid tissues and defend against re-exposure. Although accumulating evidence suggests important roles for TRM in mediating protective immunity, fundamental aspects of the population biology of TRM remain poorly understood. Here we discuss how results from different systems shed light on the ecological dynamics of TRM in mice and humans. We highlight the importance of dissecting processes contributing to TRM maintenance, and how these might vary across phenotypically and spatially heterogeneous subsets. We also discuss how the diversity of TRM communities within specific tissues may evolve under competition and in response to antigenic perturbation. Throughout, we illustrate how mathematical models can clarify inferences obtained from experimental data, and help elucidate the homeostatic mechanisms underpinning the ecology of TRM populations.