Kafes, literally "the cage", was the part of the Imperial Harem of the Ottoman Palace where possible successors to the throne were kept under a form of house-arrest and constant surveillance by the palace guards.
The early history of the Ottoman Empire is littered with succession wars between rival sons of the deceased sultan. It was common for a new sultan to have his brothers killed, including infants, sometimes dozens of them at once. This practice reduced the number of claimants to the throne, leading to several occasions where the Ottoman line seemed destined to end. The confinement of heirs provided security for an incumbent sultan and continuity of the dynasty.