Silk worms are actually a type of caterpillar that spins silk cocoons around themselves after they turn approximately 1 month old. Whenever they are finally ready to start spinning their cocoon, they will stop eating any food and then they will turn yellowish. At this point, it will then take the silk worm approximately 3 days to spin their cocoon around themselves. If their threads are disturbed by anything, the silk worm will have to start all over again spinning a new cocoon.
The silk that is used in forming these cocoons is actually hardened silkworm saliva that has been secreted from the silk worm's mouth. There is actually a small spinneret that is located on the silk worm's lip, which is used to excreet the silk that they use to form their cocoon. This single strand of silk that the silk worm forms is about 1 mile long. Silk worms have to work in a figure 8 pattern in order to spin their cocoon around themselves.
While spending 3 weeks inside of the cocoon, they shed their skin and change into a pupa and then into moths. The moth will then emerge from its cocoon at dawn by secreting a special spit so that the silk can be dissolved and the moth can emerge. Their wings will be wrinkled before the air puffs them up in an hour and they will also “urinate” a reddish-brown fluid shortly after emerging from their cocoon since it couldn't “pee” while inside of the cocoon. They cannot eat or drink, but they go on to mate for 1 day before laying eggs and dying 5 days later. A female moth can lay between 200 and 500 eggs, which will then hatch into worms in a few weeks and carry on this continuous life cycle.