Cosmic structure has formed as a result of gravitational amplification of primordial density fluctuations together with the action of other physical processes (adiabatic gas dynamics, radiative cooling, photoionization and recombination, radiative transfer). These complex nonlinear processes, acting over a wide range of length scales (from kiloparsecs to tens of megaparsecs), make this a difficult problem for computation. During the last two decades, significant progress has been made in developing numerical methods and statistical tools for analyzing simulations and data. Combined with observational advances, numerical simulations have led to the demise of several formerly popular models and to an improved understanding of galaxy clusters, quasistellar object (QSO) absorption line systems, and other phenomena. This review summarizes these advances.