In the concordance cosmological model, galaxies form in the centers of dark matter halos and merge with one another following the mergers of their host halos. This book describes novel analysis methods, based on cosmological dark matter simulations, for quantifying the growth and merger rates of dark matter halos, and the surprising result that a significant fraction of the mass growth of dark matter halos may occur via a smooth component. Further, a modern description of observations and theories on the formation of massive star-forming galaxies about ten billion years ago is given. In particular, cosmological hydrodynamical simulations that model strong galactic winds are presented, and lessons on the evolution of massive star-forming regions in those galaxies are inferred.