Garden walls are constructed from 5 distinct elements:
The first, the subgrade, is the ground the entire structure stands upon and so its stability and load bearing ability determines on whether the wall is going to remain standing. For these reasons the wall foundation should be onto undisturbed ground that has not been built up from material such as old construction rubble or compacted hard core. For the same reason sufficiently deep so that there is no risk of frost and therefore frost heave.
The foundation of the wall is normally concrete and acts to spread the weight of the wall. Historically wall foundations could vary from nothing at one extreme to quiet complex structures and this depends more on the ground conditions and the builder/architect than the date they were built. A roman building could have a concrete foundation not unlike a modern while a country cottage built in the last few hundred years may be built straight onto the topsoil.
The walling material is the bricks, stones, etc. which forms the walls.
The mortar is the sand based material generally used between the pieces of the walling material and it serves the function of keeping the pieces of walling apart. It does not hold the pieces together, so walls have no tensile strength, but instead keeps them apart; so stopping them wobbling and stabilising the structure. The sand itself is held together by incorporating lime or more normally now cement to prevent it being washed out of the joints.
The coping tops the wall and protects it from becoming saturated with rainwater.