Without evidence, it has to be assumed that growing vegetables were the original motivation for the design of the in the sense of 'an enclosed outdoor space for horticulture'. Vegetable gardens of this kind can still be found in the less developed countries of the world.
See also: history of planting design.
A walled vegetable garden in India
A vegetable (allottment) garden in England