Cosmic inflation, a rapid expansion of the universe in its earliest moments, set the stage for galaxy formation. Inflation smoothed out any initial irregularities in the universe but also left behind small quantum fluctuations. These fluctuations eventually grew into the large-scale structures we observe today, including galaxies. Without inflation, the universe would be too homogeneous for galaxy formation to occur.