A galaxy is a large system of interstellar dust, planets and stars all held together by the gravity of either a large star or a black hole. Galaxies are classified three ways they are spiral, cluster and irregular. The spiral galaxies are the most numerous and is the type of galaxy we live in.
Galaxies appear as spirals because of a close gravitational interaction with neighboring galaxies.
This creates waves of high mass and condensed gas which continue to circle the galaxy. Existing gas compresses and causes star formation because of the waves. The Pinwheel Galaxy is a result of this. It has HIT regions which are several extremely bright star forming regions spread across its spiral arms. Because it is so large its immense gravity distorts smaller nearby galaxies.