Castles were structures built primarily in the Middle Ages that provided safety for the nobility. Some features retained by castles include moats, arrowslits, and as in the above image, a keep. The keep was heavily fortified, and as such it could be held either as living quarters, or a prison. In an attempt to not waste resources, the garrison for the castle was not large. A small force could surprisingly withstand large sieges.
The above image was taken from the Encyclopédie historique, archéologique… by Demmin, Auguste.