Silkworms have been bred over thousands of years to behave quite unlike their caterpillar cousins in the wild. That's because people purposely breed silkworms to fit this job description:
WANTEDSuperlative silk producers. Benefits include housing, unlimited food and protection from all predators. Wanderlust greatly discouraged. No opportunity for travel.
Obviously, what makes a good silk producer in captivity is very different from what helps a caterpillar survive in the wild. Commercial silkworms are dynamos at silk production, and compared to their wild relatives, rather sluggish about everything else.
Outdoors, you've probably seen caterpillars crawling to find food or hide from birds, but commercial silkworm caterpillars hardly move. For silk production, they're kept on open trays because they're content to stay put, as long as they have a steady supply of mulberry leaves. Even when they reach the moth stage, commercial silkworms are surprisingly immobile. Wild moths fly to evade predators and to lay their eggs in different areas. However, commercial silkworm moths haven't needed to do these things for thousands of years. They've completely lost the ability to fly, even though they still have wings!
Here's another difference. In the wild, moths are often very particular about where they'll lay eggs. This ensures that baby caterpillars can chomp their favorite leaves as soon as they hatch. Commercial silkworm moths have lost that instinct too. They'll even lay eggs on a sheet of paper, where it's easy for humans to keep track of them.