Since the earliest organisation of mankind into communities based on the laws and rules, there has been an understanding that there will be consequences for breaches of these laws. In the most primitive of communities these consequences may have involved stoning, exclusion from groups or other forms of punishment for law breakers is prison. The purpose of prisons is threefold: to punish, to protect society and to rehabilitate. How effectively modern prisons fulfil these functions is the subject of ongoing debate and reflection.
From the earliest recorded history of prisons one of the purposes for prisons has not changed and that is to contain a convicted criminal until the day a suitable punishment can be decided upon. Usually the punishment that would be given to the perpetrator would either involve corporal or capital punishment, nowadays in the modern era these punishments still exist but, in some countries or in certain cases the convict is instead incarcerated in the prison indefinitely.
Prisons are buildings that are for now in most countries, designed to physically confine a person who has committed a crime or crimes. It is used to hold these prisoners until the day they are released or until they are due to receive a suitable punishment. In some countries the y do not have capital punishment, therefore they are instead incarcerated indefinitely. These facilities are built to include cafeterias, recreational areas, educational and counselling facilities. Depending on the type of security of the prison and the country the living conditions of prisons differ from prison to prison.
In quite a few of the first world countries capital punishment has been removed replacing the purpose to some point of incarceration until the punishment is delivered, the punishment that has replaced capital and corporal punishment is instead permanent incarceration where the prisoner is instead held in the prison until the day they die or they are given parole.