What factors bring sand into or out of the beach?
The amount of sand on the beach at any one time is a dynamic quasi-equilibrium between a whole raft of processes. These include wave power, frequency and direction, seabed angle, longshore drift, rips and undertow, wind strength, direction and continuity, fetch, coastal geomorphology, sediment availability, offshore currents, and probably other variables. 

The entire system is too complex to summarize here, so I recommend Robin Davidson-Arnott's excellent book: 'An introduction to coastal processes and geomorphology'. Cambridge University Press, 2010.