|Merino Ram, bred in Medieval Spain|
It was suitable, however, for nomadic people, such as shepherds. Hundreds of square kilometers were open to anyone passing through, and if you had hundreds or thousands of sheep, and needed a place for them to graze, well... .
In 1212, Alfonso VIII of Castile, mentioned before because he founded the abbey whence comes the music of Las Huelgas, led a group of Christian leaders to push the Moors south, reclaiming a large part of the peninsula and making it safe for settlement. Folk started moving into what was previously a "no man's land," setting up farms and communities.
This meant clashing with the enormous number of sheep and their herders. Something had to be done, and by the late 1200s, Castile had struck an agreement that produced the most powerful agricultural union in Medieval Europe, the Mesta.
Its full name is Honrado Concejo de la Mesta ["Honorable Council of the Mesta"]. "Mesta" comes from Latin animalia mixta ["mixed animals"] because the enormous herd of sheep which you are guarding might not all belong to the same owner. Driving the sheep from location to location in search of pastureland would result in herds getting mixed together.
The Mesta had rights that persist to this day: the right to drive their sheep along certain pathways regardless of land ownership. These were called cañadas ["road along which livestock is driven"] or cañadas reales ["royal ways"; because they were established by the kings of Castile]. They still exist, and some roads through Madrid are designated as such. Sheep are not usually driven through the streets of Madrid, but nothing prohibits the practice.
Incidentally, mesta is also the root of mestengo ["ownerless beast"], where we get the word "mustang."