How does an earthworm adapt to its habitat?

they don't adapt to well to environmental change especially changes such as deforestation.