system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do we know that light from GN-z11 has traveled 13bn years? I mean what's the difference in light from GN_z11 and Andromeda?
gpt
Space itself is expanding. Not just that these distant objects are moving away from each other, but that in addition to that the space between them is expanding also.

Imagine you have two ants on a balloon and start to inflate it. They might be walking away from each other, but the distance between them is increasing faster than their walking speed because the surface of the balloon is expanding due to the inflation. This isn’t a perfect analogy but you get the idea.

What we’ve found is that the rate of expansion of space appears to be constant everywhere. So if two objects are 2 billion light years apart the space between them is expanding at twice the total rate than the space between two objects 1 billion light years apart.

When light (and any electromagnetic wave) is emitted by distant objects the effect of this expansion causes the wavelength of the light to stretch. It appears to be redder than it was when emitted - this is called Red Shift. This is somewhat similar to how a police siren sounds different if it’s approaching you vs driving away.

The further away an object is the bigger the effect - the more the wavelengths are red shifted, and it’s proportional to how far away they are.

So we can look at the spectrum of light emitted by distant galaxies and compare to what it should look like - the difference between observed vs predicted values is the redshift and tells us how far away the object is.

Andromeda is almost the opposite case. It’s so close to our galaxy that the gravity between the Milky Way and it is pulling the two closer together with enough force to overcome the expansion of space, which is modest at the distance Andromeda is.