The factor that is essential to the initial formation of galaxies, according to theories of galaxy evolution, is:
Massive gas and dust clouds collapse.
This process is critical as it leads to the formation of the initial structures that can later evolve into galaxies.