Before agony meant pain, it meant competition. The word began at the Greek games, in the strain of athletes fighting for a prize.

The root is Greek agōn. Etymonline traces its meanings in order: first an assembly, a mass of people brought together, especially to watch games. Then it meant the contest itself, and finally any struggle or trial. It comes from the verb agein, "to set in motion" or "bring together." From agōn came agōnia, "a struggle for victory."

The word took its decisive turn in the Bible. In the Gospel of Luke, Jesus prays in the garden of Gethsemane before his arrest. Luke describes him as being in agōnia, and Bible Hub notes that this is the word's only appearance in the New Testament. The struggle of the arena became an inner struggle.

English borrowed the word in the late 1300s, through Old French agonie and Late Latin agonia. Its first English sense was mental suffering, especially Christ's in Gethsemane. By the 1540s it also meant the struggle that comes before a natural death, the "mortal agony." Around 1600 it widened to mean extreme bodily pain of any kind, which is the main sense today.

The sporting root still shows in the language of drama. A protagonist was originally the actor who played the first part, from prōtos, "first," and agōnistēs, "competitor." An antagonist is one who contends against another. English also kept agon itself, from the 1650s, for a contest for a prize in ancient Greece.

The newest member of the family is gentler. Merriam-Webster records "agony aunt," chiefly British, for the writer of an agony column, with a first known use in 1974. Readers write in with their private struggles, and the aunt answers. The contest has moved from the stadium to the problem page, but it is still a struggle.