Despite the limitations imposed by their environmental requirements, earthworms occupy a wide range of habitat but, as their name implies, have achieved their greatest success as soil-dwelling animals. The prolonged geographical isolation of New Zealand and the predominance of forest vegetation have resulted in the development of a forest-earthworm-fauna with species highly specialised to occupy particular ecological niches in particular types of forest, and there is an obvious stratification into leaf-mould, topsoil, and subsoil groups. The leaf-mould species are small, active, and heavily pigmented. The smallest is 15mm long and the largest 180 mm but most are between 20 mm and 50 mm. They do not make permanent burrows but move around freely in the loose material just as arthropods and other animals do; hence they are more prone to capture by predatory birds and are more frequently exposed to ultraviolet light than those species inhabiting topsoil or subsoil. Their ability to move quickly gives some protection from predators and their heavy and varicoloured pigmentation affords some protection from ultraviolet light and provides a degree of camouflage. Thirty-six species are found almost exclusively in leaf mould; most are confined to relatively small areas but at least four species (Diporochaeta obtusa, D. punctata, Neochaeta forsteri, Plagiochaeta sylvestris) are widely distributed.
Both the topsoil and the subsoil dwellers have two distinct methods of making burrows in which to live. In the first method soil is swallowed and subsequently cast either at the soil surface or in natural cracks and cavities in the soil and in deserted burrows. In the second method the anterior end of the body is extended and inserted in spaces between the soil particles and then, by contracting the longitudinal muscles, the body is expanded laterally, compressing the soil to form a burrow. Usually burrowing consists of a combination of these two methods, the former predominating in more-compact soils and the latter in less-compact soils. As a burrow is formed it is lined with slime and thus has smooth walls firmly compacted by the lateral pressure applied during its construction.
The topsoil species are generally larger than leafmould species, the smallest is about 25 mm and the largest 300 mm but most are between 75 mm and 200 mm. They are not as heavily pigmented, nor do they move as rapidly as the leaf-mould species. In most species the body is circular in cross-section but in some (especially in Maoridrilus spp. and Neodrilus spp.) the body is almost square in cross-section with pairs of chaetae on the four corners and with thick body-wall muscle layers. Such species are generally the most active. Topsoil earthworms generally make shallow permanent burrows which they leave either at mating time or in order to forage for the food which they take back into their burrows. Most species appear to continue burrowing outside the confines of their living space and apparently live, to some extent at least, by ingesting soil and digesting the organic matter contained in it. Forty-eight native species are found almost exclusively in topsoil. A number of them found in tussock grassland areas (species of Rhodo-drilus in central North Island, and Maoridrilus in eastern South Island) are widely distributed, but most other topsoil species are confined to small areas.
Subsoil earthworms are usually large, sluggish, and unpigmented. The smallest is 32·5 mm and the largest 1,400 mm, but most are between 100 mm and 400 mm in length. The majority are circular in cross-section and have weakly developed body-wall muscles. They occasionally come to the surface or near to the surface for food, but otherwise are found only in the subsoil. They make very extensive burrows extending both laterally and vertically in the subsoil and occasionally going up into the topsoil. (Burrows of Spenceriella gigantea have been found about 20 mm in diameter and still continuing downwards at a depth of 11 ft 6 in.) They appear to make these burrows to obtain food by ingestion of soil and not primarily for shelter, like the burrows of the topsoil species. As they move forward they may deposit castings in the section of burrow left behind and it is not uncommon to find burrows partly filled with subsoil castings.
Earthworms are frequently found under logs and stones, under the bark of dead trees, in rotting logs, and in the litter of epiphytes in the axils of branches of trees. Most of these are species normally found in leaf-mould or topsoil and, more rarely, in subsoils, but one, Megascolides suteri, is found almost exclusively in rotting logs and is able to digest decaying fragments of wood. Ten species recorded from the Auckland Islands have all been found under logs and stones. Most of the ground is covered with acid peat (pH3·6–4·6) which is an undesirable habitat for these particular species.