These can look like old cannonballs, they are called concretions or blueberries. And although they look perfectly spherical and look as if a person had sculpted them, they are purely natural and are formed by geological processes.
The concretions are formed by the decomposition of the organic matter buried under the sands in the seawater. The decomposition of organic molecules and the reaction with seawater lead to the formation of several compounds (predominantly calcium carbonate, for example, mineral calcite). Calcium carbonate will precipitate around its source within the radius in which it can infiltrate and bind the sediment. As a result, the ball is formed. However, the form of the concretion is not always a ball (although it is more frequent), the form of the concretion depends on the form of the organic source that decomposes.
The concretion is revealed when the solid rock that contains them is exposed and is affected by weathering and erosion. The sediment around the old organic matter in the rock is held most strongly by the minerals that formed during the decomposition of the organic matter, and therefore, it will be more difficult to erode than the sediment in other parts is the rock. As erosion progresses, the concretions will gradually reveal themselves.
Example of North Beach, Wollongong in Australia.