The walls are not continuous and are composed of multiple sections, so they are not fences. They are not tall enough to have been used as defensive barriers. The East Bay Regional Park District simply calls them "rock walls" and notes that they are not mysterious. Livestock, such as cattle, have grazed in the east and south Bay Area hills since the arrival of European settlers. Clearing land of scattered rocks would have eased the ability to move livestock. Placing the rocks into walls would have helped to guide the movement of the animals or to help corral them. https://en.wikipedia.org/wiki/East_Bay_Walls