A retaining wall is a structure designed and constructed to resist the lateral pressure of soil when there is a desired change in ground elevation that exceeds the angle of repose of the soil.
The basement wall is thus one form of retaining wall.
However, the term is most often used to refer to a cantilever retaining wall, which is a freestanding structure without lateral support at its top.
Typically retaining walls are cantilevered from a footing extending up beyond the grade on one side and retaining a higher level grade on the opposite side. The walls must resist the lateral pressures generated by loose soils or, in some cases, water pressures.
The most important consideration in proper design and installation of retaining walls is to recognize and counteract the fact that the retained material is attempting to move forward and downslope due to gravity. Unless the wall is designed to retain water, It is important to have proper drainage behind the wall in order to limit the pressure to the wall's design value. Drainage materials will reduce or eliminate the hydrostatic pressure and improve the stability of the material behind the wall.