There is a little confusion and a lot of generalization over the nature of the expansion of the universe. The general idea is that the universe is expanding at a frantic pace and galaxies are moving farther and farther away from each other with every passing moment.
While that is true for most parts, there are some exceptions too. To understand that, let us first look at the types of movements that the galaxies are subject to-
- Motion within a group– Galaxies are often clustered together in groups. The Milky Way galaxy, for example, belongs to a group named the Local Group, which houses 54 galaxies in total. The movement of galaxies in one group is often influenced by the gravitational pull of the galaxies that are close by.
- Local Flow– It refers to the movement of an entire group of galaxy in one direction in an unified way. In this type of movement, the entire group acts as one entity and move together.
- Hubble Flow– The expansion of the universe is solely responsible for this type of movement. What happens in Hubble flow is that different galaxies move in different directions as a result of which the universe expands.
Coming back to the Milky way and Andromeda, these two galaxies, which are two of the biggest galaxies in the Local Group, are drawn towards each other. The gravitational force of the dark matter present between the two is so strong that it resists the expansion of the universe.
At present, Andromeda is approaching the Milky Way at a rate of about 250,000 miles per hour or 110 km per second. Given the distance between the two galaxies, scientists have predicted that they will collide in about 4 billion years forming one giant galaxy, which has been named Milkomeda. Although it is highly unlikely that humans will be there to witness the spectacle.