Galaxies do not stay still in space. They are always moving. When they come close to each other they are attracted by gravity. Galaxies are said to be interacting when they are close enough for the gravity to start changing their shape.
These interactions can be small, or minor, like when a dwarf galaxy pulls on the spiral arms of a larger neighbour. They can also be large, or major, where 2 huge galaxies crash straight into each other.
Galaxy interactions are common. But most of a galaxy is made of empty space. There are huge distances between the stars in a galaxy. So during these collisions it's very rare for stars to crash into each other. Instead, the galaxies can start to warp each others shape, or even pass right through one another.
Major interactions can lead to the galaxies merging to become 1 huge system. It can take millions of years for this to happen, from the first time they pass each other, until they settle down to form 1 large galaxy.