The eleventh-century Archbishop of Bulgaria, Theophylact, makes the interesting and instructive point that in these words to Peter, Jesus uses the word "will," pointing to a future time. And that time, Theophylact explains, was the first Easter Sunday, when the crucified-risen Jesus came to His disciples and said to them all, including Peter, "Receive the Holy Spirit. If you forgive the sins of any, they are forgiven them; if you withhold forgiveness from any, it is withheld" (John 20:22-23).
John 20:22-23 then becomes the basis for the Lutheran understanding of "the keys." The Small Catechism contains the following terse statement, showing balance between the Church and her ministers, and held together by John 20:22-23.
What is the Office of the Keys? The Office of the Keys is that special authority which Christ has given to His Church on earth to forgive the sins of repentant sinners, but to withhold forgiveness from the unrepentant as long as they do not repent.
Where is this written? This is what St. John the Evangelist writes in chapter twenty: The Lord Jesus breathed on His disciples and said, "Receive the Holy Spirit. If you forgive anyone his sins, they are forgiven; if you do not forgive them, they are not forgiven" (John 20:22-23).
What do you believe according to these words? I believe that when the called ministers of Christ deal with us by His divine command, in particular when they exclude openly unrepentant sinners from the Christian congregation and absolve those who repent of their sins and want to do better, this is just as valid and certain, even in heaven, as if Christ our dear Lord dealt with us Himself.
When you hear your pastor say, "As a called and ordained servant of Christ, and by His authority, I therefore forgive you all your sins in the name of the Father and of the Son and of the Holy Spirit," this is the Office of the Keys in action. Most times, we hear these words on a Sunday morning - the day our Lord Jesus arose and gave this blessed authority to His dear Church.