How?
How: Theoretically, the galaxies were created in an enormous explosion, which scientists call the Big Bang. The universe was created, and space matter and planets all clustered into groups of space things called galaxies. Galaxies form when an amount of matter (large or small) is gathered by a strong gravitational pull to create stars and planets. Then, these planets and stars can be pulled together by a stronger gravitational pull, and formed into galaxies. All galaxies are are systems of stars and planets.