Why does wave refraction occur at a shoreline?
This refraction occurs for the same reason that any wave refraction does - the wave changes speed (slows down in this case) as it enters shallower water.
Water waves travelling in deep water move at a speed that is dependent only on their wavelength, but as they reach the shallower water near the shore, they are slowed. (Thus is the one of the reasons why waves get much higher as they approach shore.)
Like any wave that slows down on entering a new medium (or a different part of the same medium), the path of the wave bends away from the normal to the interface between the media.
The diagram shows how portions of the wave on the right, which have spent more time in the shallower water, lags behind the portions on the left, which travel a greater distance in the deep water. The result is to change the path of the wave - refraction!
In the second diagram, the wave approaches the shore at a 45° angle from upper left. Again, refraction is seen, this time bending the wave parallel to the shore.