Sand dunes are created by strong winds and not by coastal erosion or deposition. As sand is blown up a beach is forms small hills. These are often rooted together by long-rooted grasses such as marram grass. Marram grass is usually planted to reduce the erosion of the otherwise unstable sand dunes.
The video below shows the extent of roots ands illustrates the way vegetation helps stabilise sand dunes.