The structure of this excellent spiritual meditation on grace and our sinful nature as humans is built around the attempts of the penitent sinner of the title to gain admission into heaven, and the three knocks that he makes on the door and the three people that come to see if he is worthy to enter. The first two knocks bring, respectively, Peter and David to the gates to interrogate the sinner. When they reply, after hearing the accuser denounce them, that the sinner cannot enter, the sinner is able to challenge them on the many sins that they committed during their lifetime. Consider what the sinner says to David as an example:
Have pity on me, King David! Remember man's weakness, and God's mercy. God loved thee and exalted thee among men. Thou hadst all: a kingdom, and honour, and riches, and wives, and children; but thou sawest from thy house-top the wife of a poor man, and sin entered into thee, and thou tookest the wife of Uriah, and didst slay him with the sword of the Ammonites. Thou, a rich man, didst take from the poor man his one ewe lamb, and didst kill him. I have done likewise. Remember, then, how thou didst repent, and how thou saidst, "I acknowledge my transgressions: my sin is ever before me?" I have done the same. Thou canst not refuse to let me in.
The sinner is thus able to challenge both Peter and David about their own failings and how they, too, are dependent upon the grace and forgiveness of God. This silences both of them until the sinner knocks the third time and the Apostle John comes, whose doctrine of love and grace means that the sinner knows he can finally be admitted into heaven.
Thus the structure of this text is based around the three separate knocks on the gates of heaven of the penitent sinner, and who responds to those knocks.