Trish Fraser, a soil scientist with Crop and Food Research at Lincoln, responded.

There are lots of different types of worms, each living in different
environments so that they have less competition for the food sources
available. For example, there are earthworms (which live in soil),
compost worms (which live in compost heaps), flatworms (which live on
top of the soil) and tape worms (which usually live inside animals).
Each of these creatures eat different foods and carry out different
functions.

If we take a closer look at each of these worms we can divide them up further.
In the case of earthworms for example we have 197 different earthworm
species in New Zealand, 179 of which are natives and 18
imports, but they can be broadly described as being of three different
types. Some live close to the soil surface, others live a little deeper
down in the topsoil, and still others live in really deep burrows that
may go as far as three metres down into the soil.

Those that live near the soil surface help to mix dead plant material and
animal manure back into the soil. The ones that live within the topsoil
burrow through the soil creating channels that roots can follow and mixing
the soil so that plants can find nutrients to help them grow.

Those living really deep inthe soil tend to come up to the surface and
pull leaves and other surface litter material down into their burrows.
They use the same burrows over and over again, so their activity can,
for example, have a big effect on the way in which water flows into
and through the soil.