Most trees and shrubs will stabilize soil with their root system. So, basically any tree crop that grows well in your area will provide some erosion control. If you have a slope that is already eroding, you'll want a fast-growing tree, something that will be able to establish itself faster than the ground can erode out from under it. In general, trees that tend to grow multiple stems and form dense thickets are good for this, because they put more of their effort into growing outward than into growing up. Trees that naturally grow on streambanks are typically quite good at growing roots quickly. Examples from North America and Europe include willows, pawpaws, and hazelnuts. However, ideally you'll choose plants that are native to the area where you're planting them. Native plants provide more benefit to the local ecosystem, are less likely to become invasive weeds, and are generally less prone to serious diseases and health issues (except in the case of species affected by introduced pests).
Here are some trees native to the Andes that provide edible fruits or nuts, or other useful products:
- Luma apiculata, Arrayán, the Chilean myrtle or temu: a slow-growing, extremely long-lived tree with edible fruit; the flowers are useful for honey production.
- Maytenus boaria, Maitén: a slow-growing, drought-resistant tree; its nuts produce an oil used in varnish.
- Jubaea chilensis, Chilean wine palm, coquito: an extremely tall palm tree with edible fruit.
- Myrica: the information in Wikipedia is quite sparse, but some species of Myrica are native to the Andes, and some species of Myrica have useful fruits (some are edible, others make wax that can be used for candles, others make medicinal compounds and insect repellents). You could probably grow some of the non-native crop species in the Andes, and if you do some research on the native species you may find ones that have similar uses.
Nitrogen-fixing trees will add nitrogen to the soil. Note that when it comes to soil nitrogen, you can have too much. This site has a guide to mixing nitrogen-fixing trees with non-nitrogen-fixing trees to get a good balance and healthy soil. Here are some tree and shrub crops that fix nitrogen (actually, the nitrogen fixing is done by bacteria; the trees just give those bacteria a home):
- Rooibos: a southern African shrub used for tea. Adapted to a Mediterranean climate with rainy winters.
- Sesbania grandiflora, aka vegetable hummingbird, West Indian pea, agati, or katurai: a small tree native to SE Asia, with edible flowers and leaves used in the cuisines of south and southeast Asia. Needs good soil and a hot, humid climate.
- Hippophae aka sea-buckthorn - multiple species of shrub native to northern Europe and Asia, grown for their berries which are used for food, medicine and skincare. A hardy plant with extensive root system, frequently planted for erosion control. Tolerates drought, sea spray and salty soil. USDA hardiness zones 3 through 7. Requires full sunlight. Not related to the invasive buckthorns (Rhamnus and Frangula spp).
- Inga: a genus of hundreds of trees, most (possibly all) of which produce edible fruit. See Wikipedia's list of Inga species.
- Myrica rubra, also called yangmei, yamamomo, Chinese bayberry, Japanese bayberry, red bayberry, yumberry, waxberry, or Chinese strawberry: a tree native to eastern Asia; tolerates nutrient-poor, acidic soils; produces large crops of edible fruit.
- Shepherdia or buffaloberry: large shrubs/small trees native to North America; produce edible but slightly bitter fruit.
In addition to the list above, most members of the legume family (Fabaceae) fix nitrogen. Unfortunately, Tamarind is one of the few exceptions.
Although several members of the genus Elaeagnus fix nitrogen and produce edible fruit, resist the temptation to plant them, as they can become seriously invasive. Before planting any non-native crop, it's a good idea to research whether that species can be invasive.