What the sustainability of agricultural ecosystems depends on