A castellan is someone who oversees a castle in the absence of the castle's lord, and typically oversees basic administrative duties which keep the castle running smoothly when the lord is present. Historically, castellans were very important individuals, as they were relied on to keep castles and the surrounding areas under control. Because most castles no longer serve as private residences, this position is relatively rare in the modern era, although a few castellans can be found dotted about in various regions of the world; how their duties have been altered significantly, with a heavier focus on caretaking and less concern about military defense.
One of the aspects of the castellan's duties would have involved keeping the castle in good domestic order. The castellan would be responsible for the hiring and firing of domestic staff, supervising cleaning, cooking, maintenance, and other tasks around the castle. Typically, the castellan also made decisions about which crops to plant, when to slaughter animals, and so forth, ensuring a steady supply of food for the castle. Without this careful and conscientious management, a castle could fall into disrepair.
In addition to supervising the domestic end of things, the castellan would also have been responsible for the castle from a military standpoint. In the absence of the lord, the castellan would command the troops attached to the castle, ensuring that they stayed fit for battle, and decisions about the defense of the castle and the surrounding community might also need to be made. Castellans have also been historically been responsible for the management and care of high-ranking prisoners, some of whom were historically imprisoned in castles rather than in jails.
In addition to being the right hand of the lord of the castle, the castellan would also have been a figure of respect in the surrounding community, with the power to purchase goods for the castle, hire people to staff it, and so forth. In some regions of the world, castellans ultimately became incredibly powerful, establishing hereditary feudal positions in places like France, where they were known as châtelaines.
One notable castellan is Sir Kay, who served King Arthur at Camelot. In Arthurian legends, Sir Kay is described as an extremely talented and powerful warrior who took his duties to the king very seriously, ensuring that control of the castle remained firmly in Arthur's hands even when the king was absent.