Were there attempts to unify it before it died? Why are there so many exclaves and enclaves?
So, I don't want to be 'that guy' but... The Holy Roman Empire literally began in 800 with Charlemagne and continued, after an eighty year break between 888 and 962, in various iterations until Napoleon put a stake in its heart in 1806. So the topic is huge, literally covering over a thousand years, and no one historian can talk super knowledgeably about the whole of its existence. This, along with the fact that the Anglosphere school systems generally don't focus much on Germany (something something two World Wars) at any level of education, leaves a lot of people pretty confused on what exactly it was, especially given that the most people only seem to remember (or at least to only have been taught) that it is neither holy nor Roman nor an empire. Which is hardly a useful explanation of what it was.
However, that sort of answers your question on a very broad level. The HRE was less a country or state in the way that we think of them, and more of a concept. It's helpful to understand that being King of Germany during the Middle Ages didn't guarantee that the pope would ever agree to crown someone as emperor. The strong central state didn't start developing until the very late Middle Ages, so the German kings (who coincidentally were also usually crowned as the Emperor) didn't attempt to centralize for much of the Middle Ages. On top of that, there was much more disruption in who was king because of the inheritance practices in Germany, as opposed to France which developed primogeniture fairly early. There was less dynastic continuity because several kings died without heirs or with heirs who weren't of age and therefore weren't eligible to be elected King. This is also contra France which had several long dynasties all descended from the Capetians. This meant that the German nobility was very strong in their own lands for much longer than the French (or eventually the English), which meant the King/Emperor exerted far less control than other kings, even while the French and English were starting to exert more.
Eventually the German territories started to fracture, the imperial title moved permanently over to the Habsburgs, who couldn't actually control much of the imperial territory, and so it became more politically fractured. By the time Napoleon forced the Hapsburgs to dissolve the empire, the real world consequences were mostly that the title went away.
This is a really basic overview, of course. If you're particularly interested in a certain time or a certain map, you can specify and I/we can try to give you more context.
You might be interested in threads from the FAQ section on "The Holy Roman Empire and Centralization":
-o- "How did the German Principalities of the Holy Roman Empire obtain such crazy borders? How were they administrated? What did they mean for a common person or even wealthy merchant in the Holy Roman Empire?" (76 comments | 4 months old)
-o- "I'm confused on The Holy Roman Empire" (6 comments | 2 years old)
Centralization and the Holy Roman Empire
-o- "Was the Holy Roman Empire always very descentralized , or did it become more descentralized with the passage of time? Were Medieval Kingdoms, such as France before the 100 years War, as descentralized as HRE?" (11 comments | 5 months old)
-o- "Why did the Holy Roman Empire have such a decentralized government?" (6 comments | 2 years old)
-o- "How did the Holy Roman Empire become so decentralized?" (5 comments | 2 year old)
-o- "Did the Holy Roman Empire fragment from its original state, or did it just remain fragmented while other states centralized?" (4 comments | 1 year old)
##Followup Questions
If, after looking through the above threads, there are major questions that have been left unanswered or specific topics given insufficient detail, feel free to ask followup questions. Liberal quoting from these threads are encouraged to both allow for clearer answers and to prevent users from wasting time repeating points already addressed.
The following users are flaired on the topic and/or have answered questions on it in the past, and would likely be able to answer these followup questions:
-o- /u/butter_milk
-o- /u/HenkieVV
-o- /u/stefan2494