Population dynamics in group-living species can be strongly affected both by features of sociality per se and by resultant population structure. To develop a mechanistic understanding of population dynamics in highly social species we need to investigate how processes within groups, processes linking groups, and external drivers act and interact to produce observed patterns. We model social group dynamics in cooperatively breeding meerkats, Suricata suricatta, paying attention to local demographic as well as dispersal processes. We use generalized additive models to describe the influence of group size, population density, and environmental conditions on demographic rates for each sex and stage, and we combine these models into predictive and individual-based simulation models of group dynamics. Short-term predictions of expected group size and simulated group trajectories over the longer term agree well with observations. Group dynamics are characterized by slow increases during the breeding season and relatively sharp declines during the pre-breeding season, particularly after dry years. We examine the demographic mechanisms responsible for environmental dependence. While individuals appear more prone to emigrate after dry years, seasons of low rainfall also cause reductions in reproductive output that produce adult-biased age distributions in the following dispersal season. Adult subordinates are much more likely to disperse or be evicted than immature individuals, and demographic structure thus contributes to crashes in group size. Our results demonstrate the role of social structure in characterizing a population's response to environmental variation. We discuss the implications of our findings for the population dynamics of cooperative breeders and population dynamics generally.