Several factors contribute to soil quality in an ecosystem, including the soil's physical properties like texture and structure, its chemical properties such as pH and nutrient content, and biological properties including the presence of microorganisms and organic matter.