They mainly live underground to avoid sunlight, as sunlight removes the moisture from their skin.
The worm’s skin is protected by a thin cuticle and kept moist by a slimy mucus. This lets it absorb the oxygen it needs and expel carbon dioxide.
Darkness lets them avoid being dried out by the sun. If their skin dries out, they can no longer breathe because the exchange of gases can’t take place. Light paralyzes them if they're in it more than an hour. Then they can't move back to the safety of the soil.
Experts believe most native species were wiped out wherever glaciers covered the land. Most earthworms we see today were imported mainly from Europe by early settlers. The worms or worm cocoons traveled in the rootstocks of plants brought by the settlers from their homelands.
Europeans added soil, with its earthworms or worm cocoons, to ships for ballast. Once anchored in North American harbors, ships released their ballast -and living worms, who found new homes.
Learn more facts about earthworms from these links:
www.learner.org
www.sas.upenn.edu
www.slideshare.net