The medieval castle was primarily a fortified structure which usually housed the lord owning it and his family. The overall nature of the castle was military, so affairs related to military formed one of the most important aspects of life within the castle.
Since the lord of the castle was often required to appear with his men-at-arms whenever his overlord or the King summoned him, the lord had to keep a large body of troops and train them in military combat.
Some of these directly served the lord in fighting, others were tasked with looking after the procurement and maintenance of horses, weapons and other battlefield equipment.
During the early and high middle ages, the medieval castle was considered a military structure. As a result, most of the employees in the service of the castle were male men directly or indirectly related to military service. This also resulted in the lack of significant number of female workers in the castle, at least until the late medieval period.
In the late medieval period once the military aspect of the castle was rendered ineffective in the face of gunpowder weapons, the number of female workers began to increase.
The most important person related to military service in a medieval castle was the knight. Knights typically came from noble families and were employed by the lord who looked after their rigorous training and their battlefield experience. When the lord was required to fight at a battle, the knights directly served under him.
The knights were trained in battle on horseback but often fought dismounted contrary to popular beliefs, and in return for their service to the lord, were often given landholdings and other rewards.
Unlike most other workers in a medieval castle, the knight also had the prospect of rising in esteem and social standing over time if he proved his mettle in combat. In the castle, the knights were often accompanied by esquires who waited on them and were considered their apprentices.
Such esquires also came of noble or gentry families and had chances of rising in status over time.
Apart from knights who directly participated in battlefield combat, the medieval castle also typically housed another body of troops. This body, called the gatekeepers, were of less noble origins and guarded different gates of the castle.
On such rare occasions when the castle came under attack or a siege was laid to it, the role of the gatekeepers was crucial as they formed a frontline defence against the attackers. For this purpose, the gatekeepers not only guarded the entrance but were also skilled in combat.
Towards the late medieval period, the military significance of a castle took a backseat due to the invention of gunpowder weapons. As a result, castles stopped to serve as military structures.
The outlook of the medieval castle which had been military since the beginning of the medieval period also changed during this period. Due to this change, the number of military personnel typically employed by a castle began to decrease and the ratio of female workers rose.