Did almost all kings in the Middle Ages or later try to appoint their own bishops and archbishops rather than let the Holy See make the exclusive decisions in filling these positions? How did it usually work out?
Yes. Although the question seems to imply this was something strange or weird. In fact, it was the norm throughout the history. The appointment of bishops was always a political issue, even if the act of consecrating one was a religious ceremony (per doctrine of Apostolic succession). But someone had to decide who gets to be hand-laid upon, even if that decision was just a rubber-stamp on whomever the congregation already chose.First council of Nicea, a fresco from the Stavropoleos Church in Romania.That someone, in the early days of the Roman church, was the Roman emperor. As shown in the ideologically-packaged image above, the emperor was the true head of Christendom. It was he who summoned ecumenical councils, it was he who ratified their decisions into Roman law, and it was he who enforced it with all the might of the Roman state. The bishops were religious officials of that state, so naturally that the emperor had a say in their appointment. It is telling that in the Christian East, the schism between Orthodox Church and Oriental Orthodoxy runs along the fault lines of Melkite (Syriac for u201cRoyalu201d, i.e. u201cImperialu201d) church, which remained loyal to the Roman empire - contrary to whatever other local churches were there, which neatly slipped under Ethiopian, Persian or Muslim rule as soon as given the chance. To be a member of the Roman church meant being a citizen of the Roman state, and subjected to its law, of which the canon law was a part. The church and the empire were united in terms described as soul and the body, or a divine and mortal: and the emperor, who ruled and unified both in his persona, was a living embodiment of Christ Pantocrator.Christ as heavenly emperor, 5th century mosaic from the church of Santa Pudenin Rome.The only power that papacy had back then was the power of appeal. The papal primacy over the church was understood as a court of last resort, a final judge of sort, the u201cBuck stops here!u201d whose decisions on matters of faith were the final u201cAmen!u201d So it was to be expected that the entire Roman church be in communion with Holy See - meaning, to follow their interpretation of Christianity. Otherwise, proactive popes could (and did) employ their primacy as a sort of a judicial review, by which they overturned imperial appointments, decrees and even ecumenical councils. But the bishops of Rome themselves were appointed by the emperors in Constantinople, and whatever quarrels erupted between the two, interpreted in todayu2019s terms, were conflicts between judicial and executive government in a single, Christian state. The Duo sunt doctrine that pope Gelasius elaborated in 495 stated as much: the authority (auctoritas) of the Church legitimizes the power (potestas) of the Empire, and the power of the Empire then executes the authority of the Church.The medieval depiction of a monarch investing the prelate with insignia of his office.Consequently, the translatio imperii back to west, didn't happen so much because pope Leo put the imperial crown on Charlemagneu2019s head in the year 800, but because Charlemagne confirmed Leou2019s election as pope in 795, and judged the appointment valid in the following trial. Only an emperor could do that, and the subsequent coronation was merely a formal recognition of this fact. The Holy Roman Emperors following Charlemagne - who were, from the western point of view, the only Roman emperors, those Greeks in Constantinople remaining just sadly deluded cosplayers in their purple robes - continued to be the rightful heads of western Christendom, with the power to appoint the popes and bishops just like the Roman emperors of old. Even the Donation of Constantine, that later papal forgery with all its megalomaniac implications, explicitly admits that the papal power comes from imperial power, and not vice versa. And it is worthy to remember, that it was the Roman emperor Henry II, and not the Roman pope Benedict VIII, who in 1014 shoved filioque into the Roman rite.Of course, with the actual power of Holy Roman Emperors going up and down between Carolingian, Ottonian and Salian dynasties, the kings, dukes and rulers who were nominally imperial vassals took it upon themselves to appoint bishops in their domains, or to create new bishoprics in the lands they conquered. These were naturally required to be in communion with the pope on matters of faith, but since the papacy also wasn't in best of shape at the time, rarely anyone bothered to check. But the mess being created this way wasn't the reason behind Investiture Controversy of 11th and 12th century. That whole affair was nothing but an attempted coup against the empire, brought about by a power-hungry schemer claiming the chair of St. Peter, aided by some treacherous Germanic nobility, and cooked up by a bunch of Cluniac religious fanatics.The election of Hildebrand of Sovana as pope Gregory VII (pictured above) in 1073 was highly irregular, to say the least, and frankly stank of corruption and foul play. To cover his tracks, Gregory started a fight against simony - that is, of buying and selling of ecclesiastic offices, which was considered a grave sin whenever the church decided it to be - aimed ultimately against the emperor Henry IV. So when in 1076, the emperor had the pope deposed, the pope responded by excommunicating the emperor, and absolving all of his vassals from their oaths of loyalty to him. This brought about 50-years of feudal war in the Holy Roman Empire, that continued for centuries more in series of low-intensity conflicts between Guelph and Ghibelline parties. The so-called Gregorian reforms, far from bringing any kind of moral rejuvenation to the Christendom, in fact made the feudal chaos of Middle Ages worse: the imperial power was seriously undermined at the expense of local oligarchs, who now all turned to papacy to sanctify their private bloodsheds.The u201cexclusive decisionsu201d of Holy See in appointing bishops were nothing short of usurpations of imperial power. As laid out in the megalomaniac Dictatus papae, supposedly authored by Gregory Hildebrand himself, the papacy became hellbent on making itself the true emperor of Christendom. Holy See now began to claim the ultimate rule over various lands - not just in Italy, but in Croatia, Hungary, Normandy, England, etc. - whose rulers it was crowning as kings, turning them into its own vassals outside (and opposed to) imperial feudal order. The calling of crusades and creation of holy military orders (Templars, Hospitallers), was another step in that direction - as were the further excommunications of those emperors (Frederick I Barbarossa, Frederick II of Sicily) who tried to sort out the mess popes were creating.It is telling that the two greatest names of medieval Catholicism (or, come to think of it, of all Catholicism), Francis of Assisi and Dante Alighieri, were both anti-papal and pro-imperial in their outlook: the first one implicitly, the second one explicitly so. The Franciscan insistence on the u201cchurch of the pooru201d in reality meant that papacy has to butt out of politics and give up on its claims of temporal power. Dante went even further: Divine Comedy, interpreted politically, is an ideological pamphlet calling for restoration of imperial potestas over Christendom, and of returning papacy back into its sphere of religious auctoritas.The laws exist, but who applies them now?No oneu2014the shepherd who precedes his flockcan chew the cud but does not have cleft hooves,and thus the people, who can see their guidesnatch only at that good for which they feelsome greed, would feed on that and seek no further.Misrule, you see, has caused the world to bemalevolent, the cause is clearly notcelestial forcesu2014they do not corrupt.For Rome, which made the world good, used to havetwo suns, and they made visible two pathsu2014the worldu2019s path and the pathway that is Godu2019s.Each has eclipsed the other, now the swordhas joined the shepherdu2019s crook, the two togethermust of necessity result in evil,because, so joined, one need not fear the other:and if you doubt me, watch the fruit and flower,for every plant is known by what it seeds. (1)Thatu2019s from Purgatorio, Canto 16 - structurally, the very heart of entire poem - where Dante lays down all the evils of his time at the feet of papacy. By claiming for itself the imperial power (u201cthe sword has joined the shepherdu2019s crooku201d), it caused nothing but misrule and malin the world. Laws exist, but are not enforced by such a ruler (u201cthe shepherd who precedes his flocku201d), because he can only pontificate on what is to be done (he u201ccan chew the cudu201d), but doesn't really have the power to separate justice from injustice (he u201cdoes not have cleft hoovesu201d). Beneath all the symbolism, this is really a profoundly astute and realistic assessment of medieval political (dis)order.By claiming power over the Holy Roman Empire, the Holy See was empowering rival monarchs (Hungarian, Norman, French), who were usually worse tyrants that the emperors themselves. But the papacy could in no way control those kings that it was creating, and the chaos they caused would backfire spectacularly in its face. So when in 14th century, pope Boniface VIII reasserted his power in bull Unam sanctam - in which he, essentially, proclaimed that the salvation of every living soul depends on its subjugation to Roman pontiff - the French king Philip IV le Bel, deciding he had enough of that crap, proceeded to quite literally beat the crap out of pope.The death of Boniface VIII, after Philip IV sent a band of his marauders to empty a whole can of whoopass on the pope.This scared the bejeezus out of papacy, so much so, that for almost a hundred years to follow, they would reside in Avignon, playing the role of chaplains to the French monarchs. That worsened the chaos even further, so that by the beginning of 15th century, there were now three popes: one in Avignon, one in Rome, and one in Pisa. This clusterfuck was finally ended, at the dawn of Renaissance, by Sigismund of Luxembourg, then the king of Romans and to-be Holy Roman Emperor. It was he who in 1414 called a new Ecumenical Council in Constance, that resolved the matter by deposing all three claimants, and electing the pro-imperial Otto Colona, as the new and rightful pope Martin V.And so, to conclude with as happy end as possible, letu2019s just say that, ever since then, the bishops and prelates were appointed with the consent of their respective monarchs.