Abstract High diversity is often poorly explained by trait-based deterministic models, in part because stochastic processes also influence community assembly. Testing how deterministic and stochastic processes combine to regulate diversity, however, has been limited by the spatial complexity of these interactions. Here, we demonstrate how spatial variability in small-mammal predation on plants, mostly by granivory, results in fine-scale switching between deterministically and stochastically regulated plant community assembly in an otherwise environmentally homogeneous tallgrass prairie. We initiated assembly with the uniform application of a 24-species mixture of prairie grasses and forbs, thereby setting the maximum level of diversity (γ-diversity). In field edges with higher densities of small mammals, traits reducing seed palatability deterministically produced homogeneous subsets of less palatable plant species within the first few months after planting (low α and β diversity). As small-mammal densities decreased in more open areas, assembly unfolded stochastically on the basis of which planted species happened to land at a given location (high α and β diversity). We used randomization models to validate that this higher β diversity was explained by true differences in community structure among plots rather than by the hidden effects of increasing α diversity. The net effect at the site level was a spatially structured array of prairie species, including a positive relationship between diversity and environmental suitability relating to reduced predator intensity.