Punishment
Definitions: There are a large number of different understandings of what punishment is.

In philosophy: Various philosophers have presented definitions of punishment. Conditions commonly considered necessary properly to describe an action as punishment are that

it is imposed by an authority (single or multiple),
it involves some loss to the supposed offender,
it is in response to an offense and
the human (or other animal) to whom the loss is imposed should be deemed at least somewhat responsible for the offense.

In psychology: Introduced by B.F. Skinner, punishment has a more restrictive and technical definition.  Along with reinforcement it belongs under the operant conditioning category.  Operant conditioning refers to learning with either punishment (often confused as negative reinforcement) or a reward that serves as a positive reinforcement of the lesson to be learned. In psychology, punishment is the reduction of a behavior via application of an unpleasant stimulus ("positive punishment") or removal of a pleasant stimulus ("negative punishment"). Extra chores or spanking are examples of positive punishment, while removing an offending student's recess or play privileges are examples of negative punishment. The definition requires that punishment is only determined after the fact by the reduction in behavior; if the offending behavior of the subject does not decrease, it is not considered punishment.  There is some conflation of punishment and aversives, though an aversion that does not decrease behavior is not considered punishment in psychology. Additionally, "aversive stimulus" is a label behaviorists generally apply to negative reinforcers (as in avoidance learning), rather than the punishers.

In socio-biology: Punishment is sometimes called retaliatory or moralistic aggression; it has been observed in all species of social animals, leading evolutionary biologists to conclude that it is an evolutionarily stable strategy, selected because it favors cooperative behavior.
However, other evolutionary biologists have argued against punishment to favour cooperation. Dreber et al. demonstrate that while the availability of costly punishment can enhance cooperative behavior, it does not improve the group's average payoff. Additionally, there is a significant negative relationship between the overall payoff and the employment of costly punishment. Individuals who achieve the highest total payoffs generally avoid using costly punishment. This indicates that employing costly punishment in cooperative games may be disadvantageous and suggests that it may have evolved for purposes other than promoting cooperation.
Achieving a certain proportion of trust in the population can lead to self-governance without the need for punishment.

Examples against sociobiological use: There are also arguments against the notion of punishment requiring intelligence, based on studies of punishment in very small-brained animals such as insects. There is proof of honey bee workers with mutations that makes them fertile laying eggs only when other honey bees are not observing them, and that the few that are caught in the act are killed. This is corroborated by computer simulations proving that a few simple reactions well within mainstream views of the extremely limited intelligence of insects are sufficient to emulate the "political" behavior observed in great apes. The authors argue that this falsifies the claim that punishment evolved as a strategy to deal with individuals capable of knowing what they are doing.
In the case of more complex brains, the notion of evolution selecting for specific punishment of intentionally chosen breaches of rules and/or wrongdoers capable of intentional choices (for example, punishing humans for murder while not punishing lethal viruses) is subject to criticism from coevolution issues. That punishment of individuals with certain characteristics (including but, in principle, not restricted to mental abilities) selects against those characteristics, making evolution of any mental abilities considered to be the basis for penal responsibility impossible in populations subject to such selective punishment. Certain scientists argue that this disproves the notion of humans having a biological feeling of intentional transgressions deserving to be punished.

Scope of application: Punishments are applied for various purposes, most generally, to encourage and enforce proper behavior as defined by society or family. Criminals are punished judicially, by fines, corporal punishment or custodial sentences such as prison; detainees risk further punishments for breaches of internal rules. Children, pupils and other trainees may be punished by their educators or instructors (mainly parents, guardians, or teachers, tutors and coaches)—see Child discipline.
Slaves, domestic and other servants were subject to punishment by their masters. Employees can still be subject to a contractual form of fine or demotion. Most hierarchical organizations, such as military and police forces, or even churches, still apply quite rigid internal discipline, even with a judicial system of their own (court martial, canonical courts).
Punishment may also be applied on moral, especially religious, grounds, as in penance (which is voluntary) or imposed in a theocracy with a religious police (as in a strict Islamic state like Iran or under the Taliban) or (though not a true theocracy) by Inquisition.

Hell as punishment: Belief that an individual's ultimate punishment is being sent by God, the highest authority, to an existence in Hell, a place believed to exist in the after-life, typically corresponds to sins committed during their life. Sometimes these distinctions are specific, with damned souls suffering for each sin committed (see for example Plato's myth of Er or Dante's The Divine Comedy), but sometimes they are general, with condemned sinners relegated to one or more chamber of Hell or to a level of suffering.

History and rationale: 

Seriousness of a crime; punishment that fits the crime: A principle often mentioned with respect to the degree of punishment to be meted out is that the punishment should match the crime.
One standard for measurement is the degree to which a crime affects others or society. Measurements of the degree of seriousness of a crime have been developed.
A felony is generally considered to be a crime of "high seriousness", while a misdemeanor is not.

Possible reasons for punishment: There are many possible reasons that might be given to justify or explain why someone ought to be punished; here follows a broad outline of typical, possibly conflicting, justifications.

Deterrence: Two reasons given to justify punishment is that it is a measure to prevent people from committing an offence - deterring previous offenders from re-offending, and preventing those who may be contemplating an offence they have not committed from actually committing it.  This punishment is intended to be sufficient that people would choose not to commit the crime rather than experience the punishment.  The aim is to deter everyone in the community from committing offences.
Some criminologists state that the number of people convicted for crime does not decrease as a result of more severe punishment and conclude that deterrence is ineffective. Other criminologists object to said conclusion, citing that while most people do not know the exact severity of punishment such as whether the sentence for murder is 40 years or life, most people still know the rough outlines such as the punishments for armed robbery or forcible rape being more severe than the punishments for driving too fast or misparking a car. These criminologists therefore argue that lack of deterring effect of increasing the sentences for already severely punished crimes say nothing about the significance of the existence of punishment as a deterring factor.
Some criminologists argue that increasing the sentences for crimes can cause criminal investigators to give higher priority to said crimes so that a higher percentage of those committing them are convicted for them, causing statistics to give a false appearance of such crimes increasing. These criminologists argue that the use of statistics to gauge the efficiency of crime fighting methods are a danger of creating a reward hack that makes the least efficient criminal justice systems appear to be best at fighting crime, and that the appearance of deterrence being ineffective may be an example of this.

Rehabilitation: Some punishment includes work to reform and rehabilitate the culprit so that they will not commit the offence again. This is distinguished from deterrence, in that the goal here is to change the offender's attitude to what they have done, and make them come to see that their behavior was wrong.

Incapacitation: Incapacitation as a justification of punishment refers to the offender's ability to commit further offences being removed. Imprisonment separates offenders from the community, for example, Australia was a dumping ground for early British criminals. This was their way of removing or reducing the offenders ability to carry out certain crimes. The death penalty does this in a permanent (and irrevocable) way. In some societies, people who stole have been punished by having their hands amputated.
Crewe  however, has pointed out that for incapacitation of an offender to work, it must be the case that the offender would have committed a crime had they not been restricted in this way. Should the putative offender not be going to commit further crimes, then they have not been incapacitated. The more heinous crimes such as murders have the lowest levels of recidivism and hence are the least likely offences to be subject to incapacitative effects. Antisocial behaviour and the like display high levels of recidivism and hence are the kind of crimes most susceptible to incapacitative effects. It is shown by life-course studies  that long sentences for burglaries amongst offenders in their late teens and early twenties fail to incapacitate when the natural reduction in offending due to ageing is taken into account: the longer the sentence, in these cases, the less the incapacitative effect.

Retribution: Criminal activities typically give a benefit to the offender and a loss to the victim. Punishment has been justified as a measure of retributive justice, in which the goal is to try to rebalance any unjust advantage gained by ensuring that the offender also suffers a loss. Sometimes viewed as a way of "getting even" with a wrongdoer—the suffering of the wrongdoer is seen as a desired goal in itself, even if it has no restorative benefits for the victim.