A walled garden is a garden enclosed by high walls, especially when this is done for horticultural rather than security purposes, although originally all gardens may have been enclosed for protection from animal or human intruders. In temperate climates, especially colder areas, such as Scotland, the essential function of the walling of a garden is to shelter the garden from wind and frost, though it may also serve a decorative purpose. Kitchen gardens were very often walled, which segregated them socially, allowing the gardeners, who were usually expected to vanish from the "pleasure gardens" when the occupants of the house were likely to be about, to continue their work. The walls, which were sometimes heated, also carried fruit trees trained as espaliers.
Historically, and still in many parts of the world, nearly all urban houses with any private outside space have high walls for security, and any small garden was thus walled by default. The same was true of many rural houses and other buildings, for example religious ones. In palaces and most country houses, the whole plot, including even a very large garden, was also walled or at least fenced, sometimes with (much more expensive) metal railings along those parts of the boundary giving the best views to show off the splendour of the residence, as at the Palace of Versailles, Buckingham Palace and many others. In some cases there was originally a fence or hedging, but a wall was added later when funds allowed. In particular, hiring local labour to build a wall was considered a praiseworthy method of famine relief for the rich, and many walls round the grounds of country houses in the British Isles date to the famine years of the 1840s.
The horticultural, and also social, advantages of a walled garden meant that kitchen gardens often form or formed a walled compand within a larger walled compound. Sometimes this was for the security of the plants; in the 1630s the royal botanical garden of France (now the Jardin des plantes), itself walled all round, had an inner walled-off tulip garden, as the bulbs were valuable and prone to thefts.[1]
Metaphorically, "walled garden" may be used in many contexts (often pejoratively) to indicate a space, usually not a literal physical location, which is or is seen as closed to outsiders. One example is the closed platform in computing.