This study examines the biodiversity of earthworms in agroecosystems in the Annaba region of northeastern Algeria, focusing on the impact of agricultural practices and soil environmental conditions on these species. Seven earthworm species from the Lumbricidae and Megascolecidae families have been identified, of which five are new records for this region. Areas with intensive human activity exhibited a decrease in earthworm abundance and diversity, whereas areas with less intensive agricultural practices showed higher levels of earthworm diversity. Variations in soil properties related to land use and plant diversity were notable. Intensive agricultural practices resulted in altered soil characteristics, such as higher pH, electrical conductivity (EC), and salinity, while organic amendments increased organic carbon and nutritional diversity. Essential nutrients, such as calcium and magnesium, are crucial for earthworm vitality, while high levels of pH, salinity, and EC can reduce their populations. Canonical Correspondence Analysis supports these findings. In summary, agricultural practices and soil environmental conditions significantly influence earthworm populations, underscoring the need for sustainable methods to preserve underground biodiversity and ecosystem services.