The balls get their initial energy from this air pump , which blows them over ten feet high. The rest of the journey is just a tangled trip downhill. The wok raceway takes the balls for a spin. It's a balance between gravity trying to pull them down, and the balls' momentum trying to keep them moving in a straight line, which carries them up and out the top of the wok. As friction slows the balls down, gravity begins to win.
Gravity always wins.
One way the balls lose their energy is by making sound. This drum is one of many musical instruments built into Newton's Dream, but even when there is no special noisemaker in their path, the balls are still making noise from rubbing against the metal track. The more energy that goes into making sounds, the less energy the balls have. When it moves fast enough, it can travel upside down for a short time without falling. This works because the ball's momentum tries to keep it moving in a straight line, pushing it away from the center of the loop.