Going with the flow
Galaxies, like people, are products of their environment. Elliptical galaxies, for example, usually huddle together in groups and clusters, while spiral galaxies prefer more elbowroom.
Environment clearly plays a role in galaxy orientations, too. There are two leading theories for how this happens. One suggests that galaxies are born aligned with their surroundings, while the other assumes that alignment is something they acquire later.
Galaxies might gain their orientation in several ways. Big galaxies grow by cannibalizing smaller ones, a process astronomers euphemistically call merging. But mergers aren’t haphazard. Computer simulations show that they occur most frequently along well-defined directions as gravity shepherds material along filaments. This imprints a built-in memory of their environment on these cannibals, one that reflects the surrounding cosmic web. In a sense, giant galaxies are like spiders waiting for prey, only it is smaller galaxies rather than bugs that they devour, and the web they sit in is elongated rather than circular.
Alternatively, given enough time, gravity’s relentless tug will slowly reorient galaxies until they align with their surroundings. Theoretical calculations and computer simulations suggest this should occur on timescales shorter than the age of the universe, which means that even if a galaxy was initially misaligned with its surroundings, it should have fallen into line by today.
As is often the case in science, it’s possible, even likely, that there’s more than one explanation for galaxy alignments, with mergers along filaments and twisting due to gravitational effects both contributing to the end result.