I've heard the Capetian success in turning France into a coherent, functioning Kingdom attributed largely to "good dynastic luck". That is, a long series of French Kings each lived to father competent male heirs who were adults or near-adults when it came time for them to inherit the throne.
France, like the HRE, started out as an elective monarchy (at least once the Carolingians died out), but the early Capetian Kings were generally able to turn the elections into mere formalities, a ritual in which the nobility recognized the current King's son as his heir (legally, a junior co-King). The living King could then leverage his position to ensure the election of his son as the heir. Eventually, the pretence of elections was dropped and the French throne became officially hereditary, since it had been so long since a King's eldest son had failed to inherit that the idea of doing anything else was unthinkable.
Some Holy Roman Emperors tried to do the same thing, and a few succeeded, but in general they had poor dynastic luck (Emperors dying before they had any heirs old enough and respected enough to arrange pre-election) and weren't able to sustain the practice, so the practice of Imperial Election came to be seen as an important and jealously-guarded privilege of the upper Imperial nobility, and it was often used as leverage to preserve the nobility's other privileges.