Those stone balls in Costa Rica are natural concretions. They form underground then are exposed by the surrounding substrate eroding away. You can see the same process in action with the Muraki boulders in New Zealand - the spherical boulders are revealed as the sea washes the sandy soil away
Abusive comment hidden.
(Show it anyway.)