The basis of indulgences was said to be that the church has a "treasury of merit". This came from past Christians who had been even better than was required to gain salvation. Their good deeds were kept in a kind of bank that the Pope could draw from. He could give or sell the merit to others whose sins prevented them from being saved. 