Because we can (generally speaking) detect the *sources* of those gravitational fields.
Take a star, for instance. The star is also a source of light. So we can see the star, and thus know to account for its impact on any light that passed near it, allowing us to correct for the bend it put on the light.
Other things like “dead” stars or black holes are harder to detect, but generally not *impossible*, and as long as we can detect it and get an idea of its mass, we can account for the effect of its gravity on light.
Latest Answers