Sandbars are formed through erosion by waves is that true?

Sandbars are formed through erosion by waves is that true?