Answer: Because of different redshift of cloud.
Step-by-step explanation:
We are seeing absorption lines from clouds of gas that lie between us and the quasar, and therefore each cloud has a different redshift.
A quasar's spectrum is hugely redshifted. And most astronomers think this large redshift tells us about the distance to the quasar.