The main job of the earthworm's brain (known as the Ganglion
) is to pick up signals from the light sensors on it's skin. At the first sign of light it makes the underside of the worm spasm. In its habitat, this makes the worm disappear under the surface, whereas in your hand it wakes the worm go really wiggly, that's a pretty interesting fact to amaze your friends with.
Unfortunately for worms, fisherman realised that this wiggling is very attractive to fish and so every year millions of worms end up on the end of fishing hooks as bait.
Here is another interesting fact, experiments have shown that if an earthworm's brain is removed, they can carry on their daily lives pretty much as normal. Please take our word for it and do not attempt this experiment at home.