John Muir described large herds of sheep grazing in the Sierra Nevada Mountains in the late 1800's. Open range land was common back in those days. Even today some western states permit open range land and if a land owner wants to keep livestock off their lands they must construct fences.
My first encounter with livestock in a national forest was when I worked as a timber sale contract administrator on the Greenville Ranger District of the Plumas National Forest from 1977 to 1979. Cattle from a designated grazing allotment had wandered onto an active timber sale I was administrating, causing delays in the operations as cattle were in danger of getting harmed. These cattle had colored tags on their ears with numbers. The color of the tags indicated what grazing allotment the cattle were assigned to. I contacted the District Resource Assistant (RA), who was responsible for grazing allotments. He told the permittee/cattle owner to move the cattle back to their designated allotment area At the ranger station there was a district map on the wall of the office of the RA showing the different allotments. These areas were deemed ideal for grazing based on available range land, including meadows, sage brush grass lands, etc. My best guess was about 20% of the district was feasible for grazing. Permittees paid an annual fee based on the number of animals. By Fall all these cattle were removed from the National Forest due to snow to private lands at lower elevations. I do not remember many fences, except at some cattle guards on some forest roads. Cattle had access to streams, wet areas and lakes with no restrictions that I was aware of, or remember.
Some wilderness areas allow grazing. This is based on some of these areas classified as primitive areas before the wilderness act of 1964 when grazing allotments were permitted and allowed to continue after these areas were put into wilderness areas. I saw this on two wilderness areas I backpacked into, including the Trinity Alps Wilderness in northern California and the South Warner Wilderness in the Warner Mountains east of Alturas, California. I'm sure there are many other wilderness areas in the west where grazing is permitted.