The essential factor for the initial formation of galaxies, according to both theories of galaxy evolution, is:
Massive gas and dust clouds collapse.
This process leads to the formation of protogalaxies and is a fundamental aspect of how galaxies begin to form in the universe.