Although light does not have mass in the traditional sense, it still carries energy and momentum. In the theory of general relativity, the presence of mass or energy warps the fabric of spacetime, creating gravitational fields. Black holes, in particular, have incredibly strong gravitational fields due to their immense mass.
When light approaches a black hole, it encounters this intense gravitational field. The gravitational field is so strong that it bends the path of light, causing it to curve towards the black hole. As the light gets closer to the black hole, the gravitational pull becomes stronger, and eventually, the curvature of spacetime becomes so extreme that the light cannot escape. This region from which nothing can escape is known as the event horizon of the black hole.
At the event horizon, light cannot escape because its path is bent so severely that it essentially orbits the black hole indefinitely. It is effectively trapped within the gravitational well of the black hole. Thus, while light does not have mass, it can still be absorbed or trapped by a black hole due to the gravitational interaction between the two.