The factor that is essential to the initial formation of galaxies, according to both theories of galaxy evolution, is:
Massive gas and dust clouds collapse.
This process is crucial because it leads to the formation of stars and structures that eventually become galaxies.