When the speed of light in the two media is not the same.
When light hits an object, it can be absorbed (taken in by the object), reflected (bounced off the object), transmitted (pass through the object), or refracted (bent as it passes through the object).
Objects can bend light through a process called refraction, where light changes speed as it passes through different mediums. This change in speed causes the light to bend. Additionally, the shape and density of an object can also affect how light is bent as it passes through or around the object.
A prism is a transparent object that allows light to bend. When light passes through a prism, it is refracted or bent, causing it to separate into its constituent colors due to the different wavelengths of light.
light
When light strikes a transparent object, it can be transmitted through the object, reflected off its surface, or refracted (bent) as it passes through. The behavior of light will depend on the angle at which it strikes the object and the material properties of the object.
Refraction. This is when light changes direction as it passes from one transparent medium to another with a different optical density, causing it to bend.
Objects block the passage of light through them by absorbing, reflecting, or refracting the light. When light interacts with an object, it can be absorbed by the material, bounced off its surface, or bent as it passes through, resulting in the blockage of the light's path.
Refraction
reFRACtion There isn't a good nmeonic or the like to remember the difference between refraction, reflection and diffraction. You just have to learn it.
In reflection the light bounces bach; in refraction the light passes through, but is bent at the interface.
You can't see an object through a bent pipe because light does not travel in straight lines when passing through the bent pipe. The light rays are refracted as they enter the pipe, causing the object to appear distorted or blocked from view due to the curve of the pipe.
In a sense, light does not bend. Light sometimes passes through space (or space-time) that is warped or bent because of a nearby object having very strong gravity. The light passes through this space in what (from the light's point of view) is a straight line. To other observers the light may appear to have followed a bent path. So gravity warps space-time, and light appears to bend as it travels through this warped space-time. The light isn't doing anything except following what is a completely natural path through space.