Imagine that a wave passes from an area of deeper water to an area of shallow water, or vice versa. There is refraction.