Mealworms are found in warm, damp and dark places in nature and man-made environments. In the outdoors mealworms favor living under rocks, leaves and logs. However, they are apt to burrow into sources of food, including stored grains.
Mealworms live all over the world. They start as eggs and then larvae, resembling worms much of their four-stage lives, until they feed enough to have the energy to transform into pupae and eventually beetles.
While they are still in the larvae stage, mealworms are vulnerable to being eaten by reptiles, rodents, spiders and birds. Human beings often kill them on sight to avoid finding them in cereal, pet foods and other dry goods.
Mealworms also frequently find their way into items stored in sheds and outbuildings, including bird seed and stored garden seeds. They are able to extract moisture from grains to satisfy their hydration needs.
In general, mealworms prefer human environments as food is far easier to come by there than in the wild.
Some people keep mealworms in captivity to serve as food sources for pets, including birds, fish, reptiles and some mammals. As long as they feed the mealworms fruits and grains and ensure they have a relatively warm, dark place to live, these people are able to keep them alive long enough to feed them to their pets.