This doesn’t make much of a difference on large scales, where the universe looks essentially the same everywhere, and every galaxy “feels” a similar pull in every direction. Locally, though, gravity may overwhelm cosmic expansion and pull two or more nearby galaxies that were initially moving apart together again.
While it is true, on average and over large distances, that galaxies are moving apart, it is not true for every galaxy and on small scales. Our Milky Way and the Andromeda Galaxy, for example, have been approaching each other for billions of years. Satellite galaxies, like the Magellanic Clouds orbiting the Milky Way, are not carried away by the expansion either.
Likewise, other galaxy groups — such as the Virgo cluster — are not expanding because gravity has stopped the expansion locally. The Hubble Flow, the general motion of galaxies away from each other, is not uniform but permeated by eddies, currents, streams, and pools, as galaxies tug on each other via gravity.
Why then are there galaxies that have not collided? Usually, galaxies that have pulled each other out of the Hubble Flow will not immediately smash into each other because galaxies are small targets to hit in a large universe. Rather, they form a group or small cluster — gatherings of dozens, hundreds, sometimes thousands of galaxies — held together by gravity just like the solar system is held together by the Sun’s gravity.
Galaxies roam across the field and within groups and clusters in a disorganized way, and collisions are prone to happen. But because galaxies are small compared to the space they live in, major mergers — collisions between two equal-size galaxies that shake them up completely — don’t happen frequently. A galaxy that has joined a group or cluster can live there comfortably without ever passing dangerously close to another galaxy for billions of years.
Only a minor fraction of the Milky-Way-like galaxies that we see around us today are thought to have suffered a major collision during the past few billion years. It is a matter of time and chance, and it is an ongoing process. Galaxies, groups, and clusters continue to grow by pulling in other galaxies, groups, and clusters. The universe is still under construction today.
Of all these environments, though, a group is the most dangerous place for a galaxy to live. Galaxies that live out in the field — probably a minority of such objects — are so solitary that they seldom cross other galaxies’ paths. And while clusters are crowded, the galaxies in them move at such frantic speeds that, even when they do encounter each other, they simply race past without any ill effects.
But in groups, galaxies move at a moderate pace, similar to the speeds of their own stars in their orbits. This makes it more likely that the galaxies will not only encounter each other occasionally, but also will feel their mutual gravitational pull strongly and for a prolonged time. Thus, groups of galaxies, and not big clusters, are the most likely places where the histories of galaxies are written. — DANIEL CHRISTLEIN, UNIVERSIDAD DE CHILE AND YALE UNIVERSITY