New insights on how galaxies are formed