Millipedes eat decaying plant materials and wood particles, and they sometimes eat decayed animals like insects, earthworms and snails. If their habitats dry out, millipedes tend to invade living plants to get moisture. They help to play an important role of putting back nutrients to the soil to be used by plants.
Millipedes live in damp areas in order to get moisture. They can be found in flower beds and gardens in homes. Some also live under dead grass and mulch. Millipedes can change their habitat from time to time. Some are nocturnal, only coming out during the night to look for food.
They have spiracles on their segment, which are used for breathing. This is why they need to stay in areas that have moisture. Each segment has a pair of two legs except the first three segments that have one pair of legs. Millipedes are usually black in color with yellow, pink or purple color on the segment edges.
Millipedes protect themselves from predators with different mechanisms. When threatened, millipedes roll up to form a coil. The legs and the head are usually turned inward. This allows the outside hard part of the body to protect the soft parts. If this doesn't work, they release a chemical that makes them unappetizing.