Light Travel and Lookback Times
When astronomers observe a distant galaxy, they are observing the galaxy as it was in the past when the light left the galaxy.
For example, the Andromeda galaxy (the closest giant spiral galaxy to the Milky Way) is about 2 million light years away.
Hence astronomers see the Andromeda galaxy as it was 2 million years ago, and the Andromeda galaxy has a lookback time of 2 million years.
Although 2 million years sounds like an eternity to us, it is barely a blip on cosmic time scales, so the Andromeda galaxy has not changed significantly during its 2 million year lookback time.
For more distant galaxies, however, this light travel time becomes important.
If a galaxy is 2 billion (2E9), rather than 2 million (2E6), light years away astronomers are seeing the galaxy as it was about 2 billion years ago.
The galaxy may have changed significantly during the time that its light was traveling to reach us.
Expanding Universe and Moving Galaxies
More relevant to the question: Because the universe is expanding, the galaxy will have moved further away from us during the time its light was traveling to reach us, so the distance to the galaxy in light years does not exactly equal the number of years ago the light left the galaxy. When computing the distance to a distant galaxies, and how long ago the light left a galaxy, astronomers must correct for the expansion of the universe.
In other words: The distance that a distant galaxy travels away from us during the light travel time is a very small fraction of the distance to the galaxy, but it is not zero.
Decoding Science. One article at a time.