What is a Castle?
In the middle ages, society was organized in a system called feudalism. In feudalism, the peasants, or serfs, owed their services and money to a lord in exchange for safety. The lord also owed service to his lord, theoretically all the way up to the king, although it depended on the strength of the king. Of course, there is a lot more to feudalism then that, but that would require another article.
The castle evolved from the simple fortified house of the lord into huge stone fortresses. All castles served as some sort of home of a lord, and would be used to protect serfs during an invasion.
Evolution of Castles
Castle building started in continental Europe in response to the Viking invasions. One type of early castle was the wooden motte and bailey castle. A motte was a usually two-storey house on a hill, which was surrounded by a moat. A bailey stood at the foot of the hill and housed the hall, church, houses for the servants, a blacksmith, and pens for the animals. Both the motte and bailey were surrounded by palisade walls, and were connected by a ramp.
The main strength of a motte and bailey castle was the speed it could be put up, usually only one season. But it had many weaknesses. The wood could be burned, and it could easily be knocked down by axes or swords. In the 900s some lords started building stone keeps. The keep was a large stone tower that could house the lord, his family, his servants, and a hall in one building. This was stronger than the motte and bailey castle, but it also took longer to build.
It was also cramped in the stone keep, so richer lords started building courtyard castles, which were used in the crusades, instead. This type of castle consisted of a keep surrounded by other buildings (such as the blacksmith, chapel, hall, and stables) all surrounded by a wall and sometimes a dry ditch and later a moat. By the 1200s, concentric castles started becoming popular. These consisted of two or (rarely) more rings of thick walls.