Anathema originally meant a gift offered to the gods
Today calling something anathema means you detest it. The Greek word behind it meant the opposite mood entirely: an offering, something dedicated. The route from sacred gift to formal curse ran through ancient warfare, St. Paul's letters and centuries of church councils cutting off heretics.
Anathema comes from a Greek verb meaning to offer up. When Jewish scholars translated the Hebrew Bible into Greek, they used it for the Hebrew herem, which covered two things at once: objects set apart for God and things devoted to destruction in God's name, such as enemy cities and weapons in religious wars. Because an enemy's weapons were unholy, the sense drifted towards anything dedicated to evil, and so towards a curse.
Paul gave it a sharper Christian edge, using it for a curse and for forced expulsion from the community of believers; the noun appears six times in the Greek New Testament, meaning God's disfavour. The earliest recorded formal use came at the Council of Elvira around 306, and it soon became the standard way to cut off heretics. In 431 Nestorius faced a dozen of them from Cyril, the bishop of Alexandria. In 1054 Rome anathematised the Eastern Patriarch, who answered with one against the cardinal who delivered it. By the fifth century churches distinguished anathema, total separation, from a lesser excommunication that barred someone from the Eucharist.
The Catholic Church later reserved its most solemn anathemas, pronounced with bell, book and candle, for the gravest crimes. The 1917 Code of Canon Law treated anathema as another name for excommunication, and the current 1983 Code drops the word entirely. Eastern Orthodoxy still uses it, but insists it is not final damnation: its aims are to prompt repentance and warn others, and only the condemned person's change of heart can lift it. Each year, on the first Sunday of Lent, Orthodox cathedrals proclaim anathemas against heresies, commemorating the end of Byzantine Iconoclasm in 843.
English picked up the word in 1526 meaning something accursed, and secular speech has since softened it to anything strongly disliked.
Source: Anathema