Concretions form in a slurry of mud or sand, when a bit of organic material starts a chemical reaction that alters the minerals in the surrounding slush. Most often it forms a sphere, but sometimes all kinds of weird shapes.
Eventually the reaction stops and the slurry hardens into stone. Aeons later, when the stone is exposed, the concretions—usually harder than the surrounding rock—weather out.
As in the top photo, if you break the concretion open you may see traces of the original reaction. Pretty!