I could read a book but a TLDR would be nice. I sort of have a big blank between the death of Charlemagne and the Rise of the Austrian Hapsburgs. Their was some fight over the investures between the pope and emperor and shit something about guelphs and ghibellines in italy backing one or the other. Like really why didn't germany end up like France in terms of having a more centralized feudal state. Fucking nobles and lords in the HRE were not scared or ashamed of allying with each other and outside members against the emperor.
This question has been asked before. You might find some of the answers in the FAQ to be interesting.
But I'll take a stab at reorienting the question in a way that might be of interest that I don't think has been presented here before (or at least not that I could find in my cursory search).
Many folks look at the HRE in comparison to the centralizing proto-nation states to its west, specifically France and England. This, invariably, leads to the question of why the HRE was so decentralized, which assumes that centralization was the goal. This is teleology in its worst form. Rather, I would argue that the HRE was a highly effective entity that acted to preserve local autonomy and traditions against foreign influence, something the leaders of the principalities that made up the empire put a strong emphasis on. This is in contrast to the states of England and France in which increasingly strong regimes at the center (London and Paris) were able to subdue differing groups on the periphery (e.g. Wales, Scotland, and Ireland in the British Isles and/or Brittany, the Vendee, Bordeaux or Languedoc in France) over the course of the Middle Ages and Early Modern Period. From the perspective of the leaders and peoples of these periphery regions, I would argue that the HRE was the truly optimal state form, rather than the centralizing monarchies of the West. When seen in this light, the answer to your question of why the HRE didn't end up as a centralized feudal state like France is easily answered: Because the folks in charge didn't want it that way, and in contrast to their counterparts in France or England, were actually able to enforce their will upon the Empire as a whole.
I should note that this is not a new thesis in the field, it's actually pretty old (like from the 70s old). A good review article that explains it pretty well while sourcing the major academic contributors to the argument is: Gerald Strauss, "The Holy Roman Empire Revisited," Central European History 11:3 (1978): 290-301.