Punishment started as an invoice. The word descends from Latin pūnīre ('to inflict a penalty'), from poena ('penalty'), borrowed from Greek poinḗ — which meant 'blood money', the compensation paid to a murdered person's family.
In the world of Homer, poinḗ was not revenge but economics. If you killed someone, you owed their family a price. Payment settled the matter. The Iliad records disputes not over whether blood money should be paid, but how much.
Latin adopted poena as its word for any penalty, and from it built pūnīre — to impose that penalty. The economic origin faded; punishment became about retribution rather than restitution.
The word family that grew from poena is enormous. Pain comes through Old French peine from the same root — pain is the penalty the body pays. Penalty is poena with a suffix. Penal means 'relating to punishment'. Penance is self-imposed punishment for sin. Repent contains poenitēre — 'to cause regret', from the same root.
A subpoena — the legal summons — is Latin sub poenā: 'under penalty'. Ignore it and you pay the price. The Old English verb pīnian ('to torment'), from Latin poena, gave us pine — to waste away with suffering. Even longing, it turns out, is a form of punishment.