When waves meet shallow water they slow down.
They always bend towards the shallow side. This is why they bend towards the shore. It is a process called refraction.
It is also why waves appear attracted to us when we view them from land.
You might also enjoy:
The Difference Between Waves and Swell