Earthworms have an important ecological role as they eat decomposing organic material. They also dig tunnels in the subsoil allowing the entrance of gases and nutrients that are useful for plant roots and other living beings. So they act as decomposers and as fertilizers too.