“Agony” is, today, severe discomfort or acute pain. But it wasn’t always that way. Agony comes from Ancient Greek — an “agon” was just a contest. They had loads of contests. There were hundreds of “gymnasiums” where athletes and others would train and practice various skills, and there were constant competitions in everything from wrestling and chariot racing to drama and sculpture. Winners would be celebrated, while losers presumably slunk away to practice some more and escape their disrepute.
Today’s sense of “agony” probably stems from the unpleasantness of losing those contests. But “agony” in the sense of a contest is still represented in various places in English. A drama is most basically a contest between to characters: a protagonist and an antagonist. There’s that word, “agon” right in the middle of both. When you irritate someone, particularly if you do it on purpose, you’re “antagonizing” them.
By the 14th century the meaning of the English “agony” had been expanded to include mental anguish, which led to the late-20th century catchphrase “the agony of defeat”, which brings the word full circle back to sports contests. “The agony of defeat” was part of the introduction to the TV show “Wide World of Sports,” which is credited with introducing sports programming to television beginning in the 1960s (early television programming was almost exclusively created inside studios).
A more recent descendant of “agon” is “agonist”. This was originally a dramatic term that meant the same as “protagonist”, but more recently the word has been used in physiology. An agonist is a muscle that pulls against another muscle. The word is also used in pharmacology, where an agonist is a kind of drug that activates the molecules in cells in ways that mimic their natural processes (I’m not sure where this last use came from; it seems like it might have been based on some sort of misunderstanding). But misunderstandings have contributed an enormous amount to language; they’re nothing to get antagonistic about.