Agent-based models typically involve large numbers of interacting individuals with widely differing characteristics, rules of behavior, and sources of information. The dynamics of such systems can be extremely complex due to their high dimensionality. This chapter discusses a general method for rigorously analyzing the long-run behavior of such systems using the theory of large deviations in Markov chains. The theory highlights certain qualitative features that distinguish agent-based models from more conventional types of equilibrium analysis. Among these distinguishing features are: local conformity versus global diversity, punctuated equilibrium, and the persistence of particular states in the presence of random shocks. These ideas are illustrated through a variety of examples, including competition between technologies, models of sorting and segregation, and the evolution of contractual customs.