Kafes 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.

The last Ottoman sultan, Mehmet VI Vahidettin (1918–22) was aged 56 when he came to the throne and had been either in the harem or the Cage his whole life. He was confined to the Cage by his uncle (Abdülaziz) and had stayed there during the reigns of his three older brothers. It was the longest and last confinement of a sultan by his predecessors.

By the later years of the Ottoman dynasty, the Cage had become a metaphor for the confinement of princes rather than the actual place where they were confined. The heir of the last sultan had apartments in the Dolmabahce Palace, on the Bosphorus, where the sultan also lived.

More Info: en.wikipedia.org