system
Given the following post, respond as if you're commenting on Reddit:
human
If light is massless, how is a black hole able to prevent it from escaping?
gpt
Light is massless, but it is affected by gravity.

Two ways to understand this:

Light has energy, and gravity acts on energy.

OR

Gravity is the curvature of spacetime, and so the paths that light can travel are determined by gravitational effects.