The Holy Roman Empire was created by agreement between Pope Leo III and Charlemagne, Charlemagne having secular power and Leo ruling the Church. The relationship between Popes and Emperors was uneasy and in 1356 CE the Pope decided that Emperors must be elected. So anyone aspiring to be Emperor had to deploy massive bribes.
Charles V, the greatest Holy Roman Emperor, thus started his rule in debt, and finally abdicated, feeling that he had failed. In fact he had achieved a lot, winning many wars but failing either to control the savagely repressive actions of his subjects in the Americas or to the aggressive warlords of Europe, especially the Germans.
It could not have been easy governing such a huge and disparate realm. Charles sensibly divided the Empire between his brother and his son.