Sand bubbler crabs occupy a microscopic niche. They feed on the organic matter left in sand by the receding tide, the balls you see are the remnants of this cleaning. A pristine beach left at high tide is slowly filled by these balls. After high tide the process is restarted, creating a whole new pattern.