Later Holy Roman Empire
Friedrich II was only two years old when his father died in 1197 AD, and there were several civil wars over who held power while he grew up. Once he did grow up, Friedrich ruled both Germany and Italy for a long time, and, like his father and grandfather, he was very successful. But he cared mostly about Italy, and not Germany. He let the lords in Germany do whatever they wanted. After Friedrich died, from 1254 to 1273 AD, there was no Holy Roman Emperor.
After this gap, new emperors took charge, but they never got back the power of the earlier emperors. The Holy Roman Empire had pretty much given up on controlling Italy, which operated as a group of independent city-states like Florence and Genoa, when it wasn't under the control of Robert the Wise. By 1338 AD, the Holy Roman Emperors had lost the power to choose their own successors, and instead a group of rich men, the Electors, met to elect an emperor. Unlike in the earlier Holy Roman Empire, now the men didn't let any women get into power. These Electors soon realized that they didn't want to elect any strong rulers, who would just push them around - as long as they picked weak Emperors, the Electors could run things themselves. So that's what they did. Gradually local rulers formed their own governments that collected taxes, minted money, and ran their own court systems. Many of the Holy Roman Emperors stayed mainly on their own personal land, leaving the rest of their empire to run itself.
The Black Death, a plague which killed about a third of the people in the Holy Roman Empire in the years after 1350 AD, also made Germany poorer than it had been before. Because German Christians blamed the Jews for the plague and attacked them, many Jews moved to Poland, taking their money with them.
In 1385, the Holy Roman Emperor's son, Sigismund, married Mary, the ruler of Hungary, and he used Hungary's power to become Holy Roman Emperor himself in 1414. Around this time, blacksmiths in Northern Germany learned how to build Chinese-style blast furnaces and began to make better quality steel and sell it, so Germany got richer.
By 1440, the tide changed. The Electors elected Frederick III, a member of the Habsburg family, and he proved to be stronger than they thought he would be. He was able to get his son elected after him, and most Holy Roman Emperors were from the Habsburg family from then on. He also conquered western Hungary. Finally, in 1508 Frederick's son Maximilian I decided not to bother making the dangerous trip to Rome so the Pope could crown him as an earlier Pope had crowned Charlemagne, the first Holy Roman Emperor. Instead, Maximilian chose to be crowned nearer to home, in Aachen, Charlemagne's capital.