Walled gardens did deliver essential food for their owners. The walls protected the crop from the harsh Scottish winds. Sometimes the walls were hollow and heated from by fireplaces. Within the conservatives exotic fruit were grown, even pineapples!
Not only did the walls keep out the animals and the cold winds, but also the peasants in the old days. Once we had some apples missing -the apples were taken from the outside walls only, nobody dared to step inside.