A change of medium
The ray changes direction at the boundary
Light travels in a straight line while it stays in one uniform medium. At the boundary between air and water, its speed changes and the ray changes direction. This bending is refraction.
The normal is an imaginary line drawn at 90° to the boundary. We measure both the incident and refracted angles from this normal—not from the surface.
Snell's law
Denser optical media bend the ray inward
For the same two media, sin(i) divided by sin(r) is constant. This constant is the refractive index of the second medium relative to the first.
When light travels from air into water or glass, the refracted angle is smaller: the ray bends toward the normal. Reverse the journey and it bends away from the normal.
What your eye infers
Why a pencil appears displaced
Your brain tends to trace incoming rays backward in straight lines. Rays from the underwater part of a pencil refract as they leave the water, so that part appears closer to the surface than it really is.
Change the incident angle and material in the model. Watch how a higher refractive index produces a stronger bend toward the normal.