How does looking at distant galaxies allow us to look back in time?