When measuring the motion of distant galaxies, we use the Doppler effect to measure their speed relative to us. Basically, as a galaxy moves away from us, the light from the galaxy appears more red than it actually is. This is similar to the way the sound of a train can sound lower as it moves away from you. Of course things aren’t quite that simple because the Universe is also expanding. This means that the redshift of a galaxy is partly due to its motion relative to us, and partly due to cosmic expansion. This cosmic expansion is known as the Hubble flow.
The Hubble flow is what makes more distant galaxies appear to be moving away from us more quickly than closer galaxies. For distant galaxies the Hubble flow becomes the main part of its redshift. But the gravitational interactions of galaxies can give them motions that add or subtract to the Hubble redshift. One example of this can be seen in Hubble’s original data, where the redshifts of galaxies in the Virgo cluster clearly differ from the overall Hubble relation.
We can also measure the Hubble flow in other ways. Observations of the cosmic microwave background and gravitational lensing allow us to determine the rate of cosmic expansion as well. This means we can use the redshift to get an idea of how galaxies move relative to each other. We can also use the cosmic background to determine that the Milky Way is moving about 370 km/s relative to the Hubble flow. So when we measure the redshift of other galaxies we need to take that into account.
When studying cosmology, sometimes it helps to go with the flow.