A short history lesson to understand the developments in Bavaria...:

The Secularisation Period in Bavaria (1802-1803) brought an end to the era of baroque churches.
It was part of the German Mediatisation Period was the series of mediatisations and secularisations that occurred in Germany in 1795–1814, during the latter part of the era of the French Revolution and then the Napoleonic Era.

Mediatisation = the process of annexing the lands of one sovereign monarchy to another, often leaving the annexed some rights.

Secularisation = the redistribution to secular states of the secular lands held by an ecclesiastical ruler such as a bishop or an abbot.

Following the collapse of the Carolingian Empire, due to the equal heritage splitting prescribed by Salic Law, and the rise of feudalism, much of Europe had been reduced to an array of small, independent statelets. Successive Kings of Germany and Holy Roman Emperors vested temporal authority on many bishoprics, abbacies and convents, and also granted free city rights to many cities and villages throughout Germany. Unlike England and France, for example, the German kings were unable to coalesce their realms into a fully centralised kingdom, so over the course of centuries Germany had come to consist of no less than 300 independent states.

The Reichsdeputationshauptschluss (formally the Hauptschluss der außerordentlichen Reichsdeputation, or "Principal Conclusion of the Extraordinary Imperial Delegation") was a resolution passed on 25 February 1803 by the Reichstag (Imperial Diet) of the Holy Roman Empire. It proved to be the last significant law enacted by the Empire before its dissolution in 1806.

Based on a plan agreed in June 1802 between France and Russia, and broad principles outlined in the Treaty of Lunéville of 1801, the law established a major redistribution of territorial sovereignty within the Empire, to compensate numerous German princes for territories to the west of the Rhine that had been annexed by France as a result of the wars of the French Revolution.

The Reichsdeputationshauptschluss was ratified unanimously by the Reichstag in March, 1803, and was approved by the emperor, Francis II, the following month. However, the emperor made a formal reservation in respect of the reallocation of votes within the Reichstag, as the balance between Protestant and Catholic states had been shifted heavily in the former's favour.

The redistribution was achieved by a combination of two processes: secularization of ecclesiastical principalities, and mediatization of numerous small secular principalities.

From the re-establishment of the Holy Roman Empire by the Salian and Saxon Emperors in the 10th and 11th centuries, the feudal system had turned Germany and northern Italy into a vast network of small statelets, each with its own specific privileges, titles and autonomy. To help administer Germany in the face of growing decentralisation and local autonomy following the rise of feudalism, many bishoprics, abbacies and convents throughout Germany were granted temporal estates and noble titles—such as prince, duke, or count—by successive Holy Roman Emperors. The personal appointment of bishops by the Holy Roman Emperors had sparked the investiture controversy, and in its aftermath the emperors were unable to use the bishops for this end. Following this, the bishops and abbots had begun to run their newfound realms as a temporal lord as opposed to a spiritual lord. The endemic corruption and decadence that followed had led to the falling from grace of the Ecclesiastical rulers, and eventually led to the Protestant Reformation. The Counter-Reformation re-established the relevance of the Prince-Bishops, as they had become known, but by the end of the Thirty Years' War and the Peace of Westphalia, the new system whereby the inhabitants of a state were expected to follow the religion of the ruler left the Prince-Bishops again obsolete.

In 1797, Napoleon Bonaparte of France defeated the armed forces of the Holy Roman Emperor and by the Treaty of Campo Formio annexed all the lands of the Holy Roman Empire west of the Rhine River. The Holy Roman Emperor was bound by duty to compensate the now stateless monarchs who lost their lands to grant them new estates. The only available lands were those held by the Prince-Bishops, so they were secularised and dispersed amongst the monarchs of Germany.

The ecclesiastical states were generally annexed to neighbouring secular principalities. Only three survived as non-secular states: the Archbishopric of Regensburg, which was raised from a bishopric with the incorporation of the Archbishopric of Mainz, and the lands of the Teutonic Knights and Knights of Saint John. Also of note is the former Archbishopric of Salzburg, which was secularised as a duchy with an increased territorial scope, and was also made an electorate.

Monasteries and abbeys lost their means of existence as they had to abandon their land and closed in large part.

SOURCE: Wikipedia - please help support it!