The Hubble Space Telescope is in the news every now and then. How can it photograph galaxies that are millions of light years from Earth?

We can understand that light comes from galaxy and Hubble "catches" it.
But does nothing come between the galaxy and Hubble that absorbs or scatters the light over a distance of say 30 million light years? How? Or is there any other concept?