I also wondered how they stay in place.
this page suggested it's a friction fit
It really as simple as finding the right drill bit, drilling a hole in the fence, and then using a rubber mallet to gently secure the marble in place. You want the marble to be snug as a bug.
One thing to be aware of is the marbles will fall out as the wood swells and shrinks due to temperature change. It’s not hard to stick the marbles back in place!
Sounds like a bit of a bother. I bet there is a better way.