Why do water waves refract at the boundary of shallow water and deep water in a ripple tank experiment?

Water waves refract because their speed changes when moving from one depth to another, causing a change in wavelength and direction.