This “magic trick” reveals how relative densities cause objects to float or sink, even in a sea of solid beans.
Objects with a density lower than the fluid that they are submerged in will float and objects with a greater density will sink.
In this set-up, the pinto beans form a coarse fluid. The metal ball has the highest density, the ping-pong ball has the lowest density, and the pinto beans have a density somewhere in between.
The fluid begins to flow when the container is shaken from side to side. The high-density metal ball sinks, while the low density ping-pong ball bobs up to the surface.
If shown as a magic trick, it appears that the metal ball turns into the ping-pong ball.