Retaining walls are intended to create large height differences in the garden. They can hold back soil. In addition, they are extremely strong, which means they can support a higher terrace, lawn or border.
Edging is intended to separate the various elements in the garden from each other. Think of the lawn, borders, terrace, paving, flower boxes, walkways, etc.