The term comes from the Latin expression cum clave (literally "with a key", seclusion). The electors (some of the cardinals, those below a certain age) are in fact closed into a special area of Vatican palaces and vote in Sistine Chapel, without contacts with outside. (For the coming election,the cardinal electors will be housed in a new building, the Domus Sanctae Marthae, but will continue to vote in the Sistine Chapel).
Despite many legends on this particular event, it was Pope Gregory X, with his constitution Ubi periculum maius (of 1274) to prescribe rules and methods for the election of the bishop of Rome (a fundamental charge of the Pope). His own election (1271) had happened in Viterbo (some 100 km north of Rome) and the polls had lasted more than two years, they were positively ended only when the local authorities closed the cardinals into a restricted area, banning eventual contacts with others and finally - decisively - cardinals were only given bread and water (this forced seclusion by civil authorities had already happened, indeed, in Perugia and in Rome).
During the Second Council of Lyon, Gregory X presented his constitution, that prescribed the complete seclusion for cardinalss, in order to subtract them to any eventual external influences. They had to meet in the town in which the previous pope had died, if not an interdicted town, in the palace of the local bishop. In Gregory's severe rule, food was sent in through a window and, if a pope hadn't been elected on the third day, cardinals would have received only one meal per day in the following 5 days. After the 8th day, only bread and water could be sent in, and wine only for rites. Any violation was punished with excommunication. Also, all ecclesiastical revenues were suspended for the length of Conclave. The following election, indeed, lasted only one day...
The rule was included by Pope Celestine V in his decrees (he had been elected after a vacancy of two years), then in 1621 Pope Gregory XV issued a constitution (Aeterni Panis) containing well detailed regulations. After, the rule was mildened by Pope Leo XIII (const. Praedecessori nostri) then later confirmed first by Pope Pius X in his const. Vacante sede (1904), who included it in canon 160 of canon law (notably, abolishing the veto, the faculty of refusal of the new pope by some catholic sovereigns), and later by Pope Pius XII in his const. Vacantis Apostolicae Sedis (1945).
A motu proprio by Pope John XXIII gave further notes about the election. The next election will be governed by Universi Domenici Gregis, the election constitution decreed by Pope John Paul II in 1996, which introduced further reforms.
15 (or at the most 18) days after the death or the resignation of the previous Pontiff (they were 10 days in Gregory's first rule), the dean (the eldest cardinal) calls the other cardinals into the conclave, interrupting any communication with the external world (those cardinals eventually late, will be admitted if the pope has not been elected yet).
Cardinals might be accompanied by two conclavisti (laymen or priests - 3 in case the cardinal is unhealthy) that must not be relatives (nor married with, or sons of relatives) of the cardinal. The number of conclavists has been steadily restricted since then as the number of Cardinals has grown. They are now required to be priests and only permitted when Cardinals are ill.
Other people admitted to the Conclave include:
Modern elections
Everyone, cardinals included, is subject to maximum secrecy about what happened in the conclave, and especially about the facts, the comments, the interpretations of the votes. Some exceptions were notably made in recent times about the election of Pope John Paul I, when many cardinals could not avoid describing some extraordinary aspects of this election.
Cardinals enter Conclave with a procession, singing the Veni Creator. Immediately after, places are verified not to contain any unauthorised people and the keys are given to the Cardinal Camerlengus. A draw is made for assigning the cells in which cardinals will stay and the procedures may begin.
The election may come:
Faithfuls usually wait for the results of polls in St.Peter's Square, from which they can see the fumata, the smoke of the voting papers that are burnt at the end of each poll: if the smoke is black (fumata nera - something is added to the fire to make it dense and dark), nothing has happened. If the smoke is white (fumata bianca), in a short time the dean will appear at the main balcony of the basilica's façade (the Loggia) to introduce the new pope with the famous latin sentence "habemus papam: eccellentissimus ac reverendissimus cardinal...". The pope will then give his blessing.
The ceremony of the crowning with the triregnum (the triple crown or Papal Tiara) and the tiara was abolished by Pope John Paul I.