How are erosion and deposition involved in forming a beach?
A beach usually has a source of insoluble inorganic materials such as (1) a rock outcrop that is eroded by strong waves, (2) a river or stream or estuary that outflows suspended sediments, or (3) an offshore coral reef that provides abraded calcareous debris (sea shells, coral skeletons, hard body parts).
Depending on the energy state of the moving water, the beach could have large or small sediments. High-energy beaches (strong waves) have cobbles, pebbles, and granules, while low-energy beaches (small or no waves) have sand, mud, silt, or clay. The waves carry and push the particles along the shore from the source of the sediments to where they are eventually deposited. The process of swash and backwash in which incoming waves alternately suspend and then deposit the sediment while moving it parallel to the shoreline is called "longshore drift."
During times of strong waves, heavier debris could be brought higher up to the beach and then piled up as thick berms. Material that doesn't end up high on the beach eventually gets re-suspended or washed out to sea again.