Mexican jumping beans are the seed of a particular shrub from Mexico, in which, a moth lays eggs that develop into larva that move. This causes the hollow seed to move and jump, according to EarthSky.
The shrub bearing the seed grows on the rocky slopes of the Mexican states of Sonora and Chihuahua. The moth lays its eggs on the immature seed pod. When the insects enter the larva stage, they bore into the immature seed and consume the seeds. The pods then fall to the ground, breaking into three segments. These segments are the outer shell of the Mexican jumping bean. As the larva move, they hit the outer shell, causing the seed pod to move or jump.
According to Reference.com, the jumping mechanism helps to protect the larva from drying out in the sun. It is possible to prolong the life of Mexican jumping beans by soaking them in dechlorinated water several hours every two weeks. If they become too dry or freeze, the larva dies. With proper care, the larva sometimes lives several years inside the bean. Some larva enter the pupa stage and eventually become an adult moth. The moth has a very short lifespan, and it normally dies within two to three days.