Sand beaches are made of sediment from the ocean and from land.
What the sediment is made of depends on what is available from the surrounding environment. Wave activity carries the sediment between the ocean and the beach.
Strong, quick waves do not give the particles of sediment time to settle on the floor. They stay in motion, dragged farther from land until they reach calmer water. There the sediment settles to the bottom, often creating sand bars or barriers.
Calmer waves deposit sediment on the shore. Much of it is swept back toward the ocean, but enough time passes before the next wave to allow the sediment to settle. As a result, more sediment builds up along the shore.