Right of patronage
The right of patronage gives a layman (or today a state) a say in the appointment of clerics. When granted to Spanish and Portugese kings it was anchored in concordats as “royal patronage”, (Spanish patronato real, Portugese, padroado real). Conquistadores were to convert the inhabitants of Iberia, Africa, America and Asia and they were allowed by the pope to reduce any stubborn pagans to “perpetual slavery”. Later, patronage was granted to former colonies willing to give the Church a free hand in missionising.
The right of patronage is a term from canon (church) law. This right can be conferred upon a benefactor to the church, "the first and chief privilege of which is the right of presenting (appointing) a cleric".  Further social rewards for making large donations to the Church included having your coat-of-arms displayed in the church, walking ahead of your neighbours in religious processions and occupying "the more dignified seat in the church".  This meant sitting "as close to the altar as decency permitted". 
The Church has, in recent times, been trying to rescind as many of these perks as it can.
The right of patronage is hedged about with restrictions in the 1917 code of canon law. Cardinal Pacelli, (later Pius XII), who wrote this code, wanted to tighten papal control by ending the practice of laymen choosing priests. The code forbids the granting of new patronage rights  and instructs clerics to try to persuade existing patrons to accept posthumous prayers for their souls, instead, "even perpetual ones". 
The Second Vatican Council in 1965 introduced further restrictions. Its Decree on Bishops (para. 20) says that "in future no more rights or privileges of election, nomination, presentation, or designation for the office of bishop be granted to civil authorities." This was then incorporated in the 1983 Code of Canon Law (Can. 377 § 5) The following year the Vatican put this into practice by clawing back from the dictator of Haiti the rights of patronage given to his father. This was an adroit move, which took advantage of the collapsing dictatorship to get an even more favorable concordat, one that would bind the next government.
Originally a concession to wealthy donors
The right of patronage originated in the Middle Ages as a compromise between the Church and its wealthy donors. The Church wanted to maintain that only the pope had the right to appoint bishops, and only they had the right to appoint priests. However, it often had to bend its doctrines to bring in more money. A wealthy "patron" who gave the Church enough land to support both the building of a chapel and the wages for its priest in perpetuity, expected to have a say in who got hired, especially if a relative had become a priest. In return, the Church was spared construction and maintenance costs and could rely on the local landowner to keep his tenants and serfs paying their tithes.
The "patron" could also be a monarch who had given the Church large sections of his kingdom. (William I gave over a quarter of the land in England to the Church.) At the royal level this conflict between the Church and its wealthiest donors led to the "investiture controversy" of the 11th and 12th centuries, when the pope and various kings quarreled over who got to appoint bishops. 
Papal permission to convert by force and enslave pagans
Several centuries later, the papacy did an about-face and dropped its blanket opposition to regal interference in the appointment of clerics. It became willing to let certain monarchs — those who were spreading the faith — appoint clerics, admit or exclude missionaries and have a say in Church affairs within their empires.
In 1452 Pope Nicolas V issued a bull, Dum Diversas, authorizing an expedition by King Alfonso V of Portugal against the Saracens of North Africa and granted a plenary indulgence to all who went on the campaign. It grants Alfonso the right to confiscate all the lands and property of any Saracen rulers he might conquer and authorises him to reduce them to "perpetual servitude." 
Three years later the pope issued another bull concerning King Alfonso. The papal directive of 1455, Romanus Pontifex, established the basis of the Portugese monarchs' right of patronage, the padroado. The king was intent on finishing Portugal's long-standing attempt to conquer Morocco and his military success there earned him the nickname "the African". Pope Nicolas V assigned the Portuguese king the task of establishing churches and monasteries on the conquered territories and supervising the priests and monks in charge of administering the sacraments. Another perk was the royal right to collect tithes for the Church. The 1455 bull repeated that the king and his successors were also granted the right "to invade, conquer, fight, vanquish and subjugate [...] the Saracens, pagans and other enemies of Christ [...] and to reduce [them] to perpetual slavery." 
In the next century Portugal founded the first global empire in history and the pope gave its king the right of presentation, that is the right to choose bishops.
Soon the right of patronage was also extended to the Spanish monarchs, who were completing the conquest of the Muslim kingdom in the Iberian peninsula. In Spain this papal privilege was known as the patronato.
In Spain, King Ferdinand and Queen Isabella, seeking to restore royal authority following a period of instability and civil war, determined to subordinate the Church. Distressed by papal appointment of foreigners and absentees, they approached Pope Sixtus IV (1471-1484), who initially rejected their proposals. However, in 1482 he reluctantly allowed them to nominate the bishops subject to papal approval. Four years later Innocent VIII (1484-92) granted them the right of appointment (patronato) of suitable persons to all the principal benefices in the kingdom of Granada then being reconquered. Subsequent concessions by Alexander VI (1491-1503) in 1493 and Julius II (1503-1513) in 1508) extended the right to all ecclesiastical offices in the New World. By granting the kings of Spain this authority, the papacy averted the possibility of a violent confrontation such as occurred elsewhere during the Protestant Reformation. 
Through the Treaty of Tordesillas of 1494 the pope divided the world into two missionary areas under the monarchs of Spain and Portugal, in the hope that they could carry out on a global scale what they had done in Iberia. In Europe guns were just coming in and Cortés brought cannons from Spain to Mexico. The project of converting the whole world to Catholicism looked promising.
Finally extended to pious presidents and dictators
Even when a Spanish colony became an independent nation, the royal patronage of Spanish monarchs could be extended if the new national regime was sufficiently Vatican-friendly. President Garcia Moreno aimed to turn Ecuador into an “empire of morality” and allowed the Catholic Church a free hand, especially in Indian areas, where the missions effectively formed the local government in many areas. Moreno let the Church enforce its morality on the natives, with Indians caught cohabiting (which was the accepted custom before marriage), might have to choose between a wedding or a beating. In return, in article 12 of the concordat, the pope made much of granting him the “right of patronage”, though, in actual fact, this only amounted to the right to choose between episcopal candidates nominated by the Church.
The right of patronage was still being granted, even as late as the 20th century, to dictators who were sufficiently helpful to the Church. During WWII the Vatican permitted Generalissimo Franco a limited role in the appointment of bishops in a provisional Convention. Several years after the war ended, when it was finally clear that this fascist dictator would remain in power, the agreement was upgraded to a concordat whose article 7 confirmed Franco's right of patronage.
Even minor dictators could bask in the glory of "royal patronage" — as long as they remained useful to the Vatican. "Papa Doc" Duvalier, the brutal devotee of vodou, had his right of veto of Vatican appointments of senior clerics confirmed in the 1966 concordat with Haiti. This was removed in the 1984 concordat with his weak son when his regime was crumbling.
The right of patronage also appears to be at the heart of negotiations with China. The appointment of bishops has been a critical issue, "including whether Pope Francis will pardon China’s eight illegitimate bishops and Beijing will recognize some 30 underground church bishops".  Going forward, it has been suggested that the final agreement with China might settle on the compromise reached with Vietnam back in 1996: the Vatican proposes a set of three bishops to the Hanoi government, and Hanoi makes its choice. However, one wonders if the Vatican would be willing to cement a compromise like this in an agreement with the most populous country in the world. 
Further reading online:
Patrick Joseph Connolly, "The Concept of Patronage", Dr. Francisco X. Martinez of Ecuador, 2011. http://www.fxmartinez.net/?p=1148
"Patronato regio: Diritti e doveri dei Sovrani" (Royal Patronage: the rights and duties of sovereigns), Wikipedia. http://it.wikipedia.org/wiki/Patronato_regio#Diritti_e_doveri_dei_Sovrani
1. A. Right of Presentation", Catholic Encyclopedia. 1911. http://www.newadvent.org/cathen/12399a.htm "Right of presentation""
2. The 1917 or Pio-Benedictine Code of Canon Law: In English Translation with Extensive Scholarly Apparatus, trans. and ed. Edward N. Peters, 2001. http://books.google.no/books/about/The_1917_Or_Pio_Benedictine_Code_of_Cano.html?id=2XbtF6Y21LUC&redir_esc=y
The privileges of patrons are:
1. Presenting a cleric to a vacant church or vacant benefice;
2. [...] if there is a surplus of goods obtained from equity or from the assets of the church or of the benefice, as often as the patron, through no personal fault, has been reduced to poverty [... for the patron] to receive a payment within the limits of the foundation [...]
3. Having, if there is a legitimate custom in the place, the clan or family coat of arms in the church of patronage and of taking precedence before other laity in processions and similar functions and [of occupying] the more dignified seat in the church, but outside of the sanctuary and without a baldachin.
3. Longina Jacubowska, Patrons of History: Nobility, Capital and Political Transitions in Poland, 2012.
4. Canon 1450
5. Canon 1451
6. Richard Abels, US Naval Academy. http://usna.edu/Users/history/abels/hh315/timeline%20gregorian%20reform.htm
7. Dum Diversas (English Translation), 5 February 2011. http://unamsanctamcatholicam.blogspot.no/2011/02/dum-diversas-english-translation.html
8. António Vieira, Eduardo Lourenço, La mission d'Ibiapaba: le père António Viera & le droit des Indiens, Éditions UNESCO, 1998, pp. 102-103.
[p. 102] ...la bulle Divino Amore Communiti de 1452 (connue également sous l'appellation Dum Diversas), «concède» au roi du Portugal le droit de faire la guerre aux sarrasins, "de les envahir, de les conquérir et de soumettre leur rauyaumes, duchés, comtés, principautés et autres domaines". Et ce droit emporte en toute logique celui de réduire en esclavage perpétuel "tous les sarrasins, païens et autres infidèles"
[p. 103] ...la bulle Romanus Pontifex de 1455 ... est la première à instituer le célèbre Padroado portugais de l'Orient, qui confie aus rois du Portugal la mission d'ériger des églises, de monastères et d'autres lieux de piété sur les teritoires conquis, ainsi que le contrôle sur les prêtres et les religieux chargés d'administrer les sacrements de l'Église. C'est ce qui justifiera, au siècle suivant, le pouvoir des monarques lusitaniens der présenter des évêques à la nomination du pape. Contrepartie non négligeable de leur mission évangélisatrice, les rois du Portugal seront autorisés à percevoir la dîme. Mais la bulle Romanus Pontifex ne se limite pas à jeter les bases du Padroado, en consacre également la légitimité du pouvoir du rois portugais sur toutes les terres découvertes le long de la route maritime vers les Indes et, incedemment, sur les païens qui habient ces territoires. À cet égard, elle réitère la concession au monarque et à ses successeurs du droit "d'envahir, conquérir, combattre, vaincre et soumettre [...] les sarrains, païens et autres ennemis du Christ [...] et de réduire [ceux-ci] en esclavage perpétuel". Cette concession sera de nouveau confirmée par Calixte III en 1456 dans la bulle Inter Cetera qui confère à l'ordre du Christ la jurisdiction spirituelle sur les territoires conquis.
9. Joseph F. O'Callaghan, Electing Our Bishops: How the Catholic Church Should Choose Its Leaders, 2007, p. 79.
10. "Steps to Hanoi", America: The National Catholic Review, 21 November 2016. http://www.americamagazine.org/issue/steps-hanoi
11. "Vietnam likely the model for deal between China and Vatican", CNA, 3 November 2016. https://cruxnow.com/global-church/2016/11/03/vietnam-likely-model-deal-china-vatican/