In New Mexico and Arizona as well as in Mexico, early houses usually began as a simple one or two room box. As need and resources increased, additional rooms were added, often at right angles to the existing ones, thus forming an enclosed courtyard. In some isolated places these courtyards served as purely utilitarian spaces for small animals, laundry, and most importantly, for defense. These completed courtyard compounds could be, when required, small fortresses. However, houses that were located in towns and cities where there was a communal defense against enemies, the courtyard or patio often became an urban oasis filled with shade trees and flowering shrubs.
The courtyard of the Martinez Hacienda is an example of a fortress courtyard
This patio in Alamos, Mexico, is more of a garden or oasis
Polyzoides, Stefanos, et. al. Courtyard Housing In Los Angeles: A Typological Analysis, Berkeley: University of California Press, © 1982.
Poster, Corky. "Sombra, Patios y Macetas: Modernism, Regionalism, and the Elements of Southwestern Architecture," Journal of the Southwest, Winter 1993.