After the end of the Western Roman Empire, the whole of Europe was plunged into a period of turmoil and war. The need for a place to rest and refit was of paramount importance to the nobility of the ages.
A regular home or village was not in the cards for many of these members of the upper crust as they would inevitably be stormed and sacked by the enemy unless fortifications were made that could keep out the enemy out, and prevent the killing of the people populating that particular area.
Enter the castle. The feudal lords of the times came to realize that the only way to protect themselves and the people of their villages was to erect massive, enclosed buildings that could offer a place of refuge in the event of an enemy attack.
The first castles were built by the Germanic tribes but the true castles as you now understand them were soon invented after the Norman invasions in England saw William the Conqueror begin his plunder and reign of terror in the heartland of England.
The castle and the battlements added to defend them were soon seen as a military might in their own regard. The ability of a King to defend his people and his property were directly related to his ability to control the environment in which they were to be placed, and a castle offered this protection.
The length of time and the military required to force a King or his subjects to capitulate when ensconced in their castle fortress was a considerable deterrent to the attacking army.
The design and use of siege engines to force an army to surrender quickly became of the most urgent importance.
Siege engine design became one of the dominant necessities of war and the imagination and determination of the designers would soon change the course of the castle itself.