Why it behaves this way
Explanation
Refraction is a boundary story. Light reaches an interface, the wave speed changes because the refractive index changes, and the ray direction shifts just enough to keep the boundary geometry consistent on both sides.
This concept keeps one compact boundary-and-ray picture in charge. Incident angle, refractive indices, speed ratio, graph previews, prediction mode, compare mode, and the worked examples all read from the same interface state so the direction change never drifts away from Snell's law.