Many galaxies are members of groups or clusters. Since groups and clusters contain so many galaxies relatively close together, it should not be surprising that galaxies sometimes collide with each other. Although galaxy collisions are common, stars in each galaxy are so far apart that collisions between stars are very rare.
Even if galaxies don’t actually collide, though, they can still affect one another. When two galaxies pass close to one another, the force of gravity they exert on one another can cause both galaxies to bend out of shape. Both crashes and near misses between galaxies are referred to as “interactions.”
At the right, you can see two galaxies interacting. You can see they are being distorted by the gravitational interaction between them. Can you imagine what they might have looked like before they interacted?
When two galaxies interact, clouds of gas inside each galaxy may become compressed. Compressing the clouds can cause them to collapse under their own gravity, turning into stars. This process can lead to a burst of star formation in interacting galaxies, leaving a new generation of stars in a galaxy where normal star formation may have ceased long ago.