More than two-thirds of the galaxies are disc shaped. Most disc galaxies have spiral arms and are called spiral galaxies.
According to the law of conservation of angular momentum, the total angular momentum of a system isolated from the rest of the universe remains constant regardless of what happens within the system. When the galaxy initially formed by gravitational attraction then total angular momentum is conserved.
Angular momentum formula is given by
L = r × (m*v)
where L is the angular momentum, m is the mass of the object, v is the magnitude of its velocity, and r is the position vector (relative to some origin).
From this formula we can see that if the angular momentum is conserved then a decrease in the position relative to the center will lead to an increase in velocity. Thereby, the gas, dust and stars form galaxies begin to swirl faster as they fall inward toward greater concentrations of matter. The initial collapse of randomly moving gas and stars forms a nucleus with a defined orbital spin. The upward and downward motion of the remaining diffuse gas clouds cancels in order to conserve the angular momentum. The gas clouds maintain only the orbital motion around the nucleus and form the disk galaxy. The disk galaxy constantly interacting with other galaxies. When one galaxy close enough to another, the resulting forces are grouping stars in spindly shapes.
The Sagittarius Dwarf Elliptical Galaxy a satellite galaxy of the Milky Way. “The Sagittarius Dwarf had actually collided with the Milky Way twice—once 1.9 billion years ago and again 0.9 billion years ago.” The result of these collisions is the spiral form of the Milky Way that we have today.
Image Credit: NASA