What does the nervous system do?

Our brain sends them messages through a network of nerve cells that make up the nervous system.
When you decide to pick up a pencil, your brain sends a message through the nervous system to the muscles in your arm and hand to start moving.
The nervous system also carries messages to the parts of your body that move without your control, such as your heart and stomach.
Most animals have some kind of nervous system. But no animal has a brain as well developed as the one in human beings. 
When animals are in danger, messages travel through the nerve cells to tell the different parts of their body what to do.
If a mouse sees a cat, messages will be sent quickly through the nerve cells of the mouse to tell it to run away.
In the same way, a snail will pull its head into its shell for protection when it senses a threat.
What does the nervous system do?