The Great Harzburg (Hartesburg) was built in a strategically favorable location by King Henry IV (from the gender of salaries) during the castle building program in Saxony from 1065 to 1068. Henry's master builder was the later Bishop of Osnabrück, Benno II. The imperial castle served to secure the nearby imperial palace of Goslar. Its walls reached up to the steep edge of the mountain cone. The castle was considered impregnable by the standards of the time. In spite of its fortified nature, the castle was also particularly splendidly equipped. The castle contained an unusually large, three-roomed palace and a collegiate church, into which Henry had numerous relics transferred. He also created a kind of family tomb at the castle by reburying the bones of his brother Conrad II, who died young, and his son Henry, who also died at an early age.
At the beginning of the Saxon War in 1073, Henry IV had to flee from the imperial palace of Goslar to Harzburg Castle together with the imperial insignia. Allegedly, 60,000 besiegers followed him and his castle garrison amounted to 300 men. According to legend, the king finally fled through the well and a secret passageway, during which his crown is said to have fallen into the well. In the Peace of Gerstungen of February 2, 1074, Henry had to agree to the demolition of his castles, including the Harzburg. He delayed the destruction, however, and had only the walls and towers of the Harzburg moved, while the buildings remained standing. The Harzburg was then plundered and completely destroyed in the spring of 1074 by angry peasants from the surrounding area. In the process, the collegiate church was not spared and the royal family crypt was desecrated. This was the reason for Henry to again act with all severity against the rebellious Saxons and so the defeat of the rebellious Saxons in the battle of Homburg at the Unstrut river took place on June 9, 1075.
from https://de.wikipedia.org/wiki/Harzburg
After a model in the Roman-Germanic Central Museum, Mainz