The sale of indulgences was a byproduct of the Crusades in the 12th and 13th centuries. Because they risked dying without the benefit of a priest to perform the appropriate ceremonies, Crusaders were promised immediate salvation if they died while fighting to "liberate" the Christian holy city at Jerusalem. Church leaders justified this by arguing that good works earned salvation, and making Jerusalem accessible to Christians was an example of a good work. Over time, Church leaders decided that paying money to support good works was just as good as performing good works, and it evened things up for people who were physically incapable of fighting a Crusade. Over several centuries, the practice expanded, and Church leaders justified it by arguing that they had inherited an unlimited amount of good works from Jesus, and the credit for these good works could be sold to believers in the form of indulgences. In other words, indulgences functioned like "confession insurance" against eternal damnation because, if you purchased an indulgence, then you wouldn't go to hell if you died suddenly or forgot to confess something. In later years, the sale of indulgences spread to include forgiveness for the sins of people who were already dead. That is evident in this passage from a sermon by John Tetzel, the monk who sold indulgences in Germany and inspired Martin Luther's protest in 1517.
But our DOCTRINE did not change like that jim jones, Koresh, osteen and graham preach!!
—Lame_Catholic_apologist(Hail Mary, Mother of GOD...)