Trees help to prevent soil erosion: When trees are planted along the banks of rivers, they help to anchor the soil in place and prevent erosion. This is especially important in areas prone to flooding or heavy rainfall, as the roots of the trees hold the soil in place and prevent it from being washed away.