Bugs do not survive without protection for very long. Unlike other animals, bugs have an exoskeleton on the outside of their bodies. This is a shield that protects the bug. When the bug grows and the shell becomes too tight, it molts. When a bug molts, it means the bug sheds its shell.
The life cycle of bugs is very interesting. Most bugs start out as eggs. When they hatch, the new bugs are called nymphs. The nymphs look like their parents but do not have wings. As they grow bigger, nymphs shed their shells several times.
Some nymphs protect themselves by making a foamy hideout. This foam is called spittle. Nymphs produce a sticky liquid that they blow into a foam. The spittle protects them in two ways, it protects them from sunburns and hides them from predators.
So just remember, bugs can protect themselves in many different ways, just like humans and animals.
[Source: Big Bug Book]