Galaxy formation is currently thought to occur with the collapse of clouds, presumed to be under the influence of a high-density region of dark matter. Simulations, as well as galaxy morphology population statistics are used to test theories. Theories have been developed to form a galaxy (e.g., spiral galaxy) from a single collapse, or to build galaxies from smaller collapses, e.g., out of globular clusters.
A collapsing (plasma) cloud must cool sufficiently to allow star-formation to begin, which requires sufficient transparency to allow electromagnetic radiation to carry away energy, suggesting a maximum size of galaxy that can form, perhaps 1012 solar masses. If the temperature is sufficiently low that hydrogen becomes neutral, the cloud becomes opaque, perhaps at 108 MSun, suggesting that prior to galaxy mergers, galaxies form in this range.