Cool It!
300,000 years after the big bang, after the expansion of the universe had cooled it enough for electrons to recombine (or, actually, combine for the very first time) with hydrogen and helium nuclei, the distribution of baryonic matter (which, in the peculiar argot of astrophysics, means both baryons and electrons) was very uniformly distributed, with density perturbations typically one part in 100,000. So how do you get that stuff to cluster to the point where density perturbations are 199 parts in 200 to form galaxies or another 10^20 plus to form stars? The first part of the answer seems to require dark matter, which, being impervious to the smoothing effects of photons and electrical interactions, had already gotten rather more concentrated. It's clumps attracted the now neutral baryonic matter. However, just as expansion of the universe had cooled the overall cosmos, local contraction (to form galaxies and stars) heats it back up, and that heat generates pressure whi...