No European country had ever tried to govern an empire as large and far away as the Spanish empire in the New World. Sure, some European states controlled territories that didn't border each other, but 3,000 miles of ocean separated America from Europe. So Spain was forced to improvise. Initially, Queen Isabella's grant to Columbus made him "Admiral of the Ocean Sea" and ruler of all the lands he discovered. When Isabella realized that Columbus had discovered a whole lot, she revised that decree and the Crown began governing the New World. At first, rivalries between feuding conquistadors made for a wild and woolly environment, but by the middle of the sixteenth century, the Spanish government began to get a firm grip on the New World. From 1535 until independence in the nineteenth century, Spain's American empire was divided into viceroyalties and governed through a Council of the Indies in Spain. The Spanish also set up audencias which were basically royal appeals courts in various parts of the New World. There was more than one audencia in each of the viceroyalties.
Just one of the many legal fictions of the Spanish empire was that of the viceroy. Meaning under-king, the viceroy was, in legal terms, the king himself in another guise. In other words, the viceroy was more than a governor, he was the representative of the king of Spain, and therefore his word was treated as the word of the king himself, snug though the real king was 3,000 miles away in one of his many palaces.
In 1535, to better govern his colonies, the Holy Roman Emperor Charles V (who was also King Charles I of Spain—it's complicated...all the royals kept marrying each other) organized the Viceroyalty of New Spain. The Viceroyalty of Peru was founded in Lima in 1540. The massive administrative district of New Spain stretched from the Isthmus of Panama to modern-day Denver, or thereabouts. A viceroy was sent from Spain to govern the area in the name of the king, and he answered to the Council of the Indies in Madrid, who in turn answered to the king. This system was awkward with questions and responses taking up to two years to get from Mexico City to Madrid and back.
To further increase royal control, Charles organized audencias, or judicial courts of appeal throughout the New World. Royally appointed judges dispensed justice throughout the New World, making sure that the rights of the king were upheld, and—most importantly—that taxes were collected. (Little changes in the world.) Combined, the viceroyalties and audencias gave Madrid a relatively strong hold over the politics of its far-flung empire. Later, in the eighteenth century, the viceroyalties of New Spain and Peru were considered too unwieldy, so they were broken into several smaller units.
While Spain sent out viceroys and judges to America to govern, the local populations evolved in some interesting ways. The early, swashbuckling days of conquistadors and traveling priests (who were less swashbuckling) gave way to a more mature society based on local power elites. That's a fancy way of saying that there were rich and powerful residents in all the major American cities, and that major decisions were made by people far from the center of power in Madrid. Before long, a split emerged in the highest level of society between those born in Spain (called peninsulares) and those of Spanish heritage born in the New World (called criollos). This split did not take into account the masses of the population, who were either Indian or of mixed Indian and Spanish background. A type of caste system formed in which the criollos and peninsulares, who generally had different views of who should be governing the colonies, battled for supremacy. Until the late-eighteenth century, peninsulares dominated the social and political life of the American colonies. They were tied to the nobility of Spain and had powerful friends at court. But as the number of criollos grew (and remember, anyone with a single drop of Indian blood was no longer a criollo but was demoted to the mestizo castes) they began to demand more and more power. Politics became defined by this struggle—and the mestizos were left out entirely. By the nineteenth century, when ideas about freedom from the American and French Revolutions permeated through Latin America, the criollo elements decided to fight for independence from Spain. By 1824, only the islands of Cuba and Puerto Rico—the two places where the population was most pro-Spain—were left in Spanish hands. The criollos won and Latin America gained its independence.
In northern New Spain, things were a little different. In these lands, which would one day become part of the United States, contact between Indians and Spaniards was more limited, and the large-scale divisions in Spanish society were muted. Part of this was due to numbers; there were far fewer Indians in the deserts of what would become the American Southwest, and also fewer Spaniards. Many of the Spaniards were priests in missions set up throughout the region that we now know as the states of the states of Texas, New Mexico, Arizona and California.
Law and order were limited; these areas were the Wild West for the Spanish before they were the Wild West for the Americans. The frontier was the frontier, no matter which country was in charge. With few people and few resources, these areas were left mostly to themselves by the Spanish, especially north of the Rio Grande. Politically isolated and ruled by Franciscan and Dominican friars as much as by representatives of the Spanish government, the Indians in the American Southwest were left to lead their lives mostly unchanged. The familiar Spanish colonial policies of repression and forced labor did not exist in many areas of the West and Southwest, especially after the Popé Rebellion in 1680.
The Pueblo Indians of what is now New Mexico, reacting to an attempt by the local Spanish administration to stamp out some native religious practices, rebelled, driving the Spanish out of Santa Fe for twelve full years. They were led by a medicine man named Popé—an ironic name, since he was fighting the imposition of Catholicism as much as anything else. By 1700, the Spanish had retaken Santa Fe and destroyed the rebellion, but also moderated their policies, realizing that sometimes if you can't beat 'em, you learn to live with 'em. After the initial carnage of the Conquest, the Spanish learned to govern pragmatically, and although government from Madrid was often arbitrary and was always biased towards the rich and racially pure segment of society, it was flexible enough to survive for 300 years. No other European empire has come close.