Something that's always puzzled me is how and why the HRE was an elective monarchy. Is there some kind of precedent from pre-Carolingian times or is it something that happened during the course of the empire itself? From what I understand, monarch would try their damnedest to get their sons elected as their successors (Salian dynasty, Hapsburgs, etc), but why bother with elective nature at that point? Does it have something to do with the decentralization of the Empire?
Speaking from the time period I specialize in, the institution of Princely and Ecclesiastical Electors was established because of tradition and (primarily) practicality.
Charles IV promulgated the Golden Bull of 1356 to cement the formal rules of succession in the Holy Roman Empire in order to avoid the messy interregnum that followed after Frederick II, stupor mundi, was ousted from the throne in 1245.
Although the electoral positions existed far before 1356, it was not codified as strictly as Charles IV did in the Golden Bull and caused several claimants to fight for the throne, most of them electors themselves. In fact, this mission of preventing another messy interregnum is present in the preamble of the 1356 Golden Bull:
Inasmuch as we, through the office by which we possess the imperial dignity, are doubly-both as emperor and by the electoral right which we enjoy-bound to put an end to future danger of discords among the electors themselves, to whose number we, as king of Bohemia are known to belong: we have promulgated, decreed and recommended for ratification the subjoined laws for the purpose of cherishing unity among the electors, and of bringing about a unanimous election, and of closing all approach to the aforesaid detestable discord and to the various dangers which arise from it. [1]
Whether it worked or not is another matter entirely, of course.
SOURCES:
1: Translation of the Golden Bull of 1356. The Avalon Project, Yale Law School. https://avalon.law.yale.edu/medieval/golden.asp