Two-phase formation of galaxies: the coevolution between galaxies and dark matter haloes | Synapse