A retaining wall is a structure made of wood, concrete, brick, block, etc. whose function is to retain soil or other materials where the height of those materials is greater on one side than on the other. Retaining walls are often installed to hold up soil outside of the building adjacent to patios or in sloped areas of the yard, or they are used for foundations where the interior grade is lower than the outside level such (in excavated basements, for example).
When the height of the material (generally soil) that is higher on one side causes uneven forces on the wall, then the wall is subject to either overturning or sliding. A retaining wall is designed to resist those forces, usually with the use of an L-shaped footing (for concrete walls) with a base approximately 1/3 to ½ the height of the wall to prevent overturning, and a notch (or keyway) at the end of the footing extending farther down to prevent sliding. These walls are heavily reinforced with rebar to give them greater strength.