Mexican jumping beans (Spanish: frijoles saltarines) are seed pods that have been inhabited by the larva of a small moth (Cydia saltitans) and are native to Mexico.
When the eggs hatch, tiny larvae bore into the immature green pods and begin to devour the seeds.
As the tiny larvae inside curl up and uncurl, they hit the capsule's wall, and the bean appears to jump.
Physicists at Seattle University theorize, using Brownian motion as a model, that the larva's random walk helps to find shade to survive on hot days.
[3] When the bean is warmed (by being held in the palm of the hand, for example) the larva will move to eat, pulling on the threads and causing the characteristic hop.