O Key of David, O royal Power of Israel controlling at your will the gate of Heaven: Come, break down the prison walls of death for those who dwell in darkness and the shadow of death...— Great “O” Antiphon of the Canticle of Mary, for Vespers, on December 20th.
Keys are symbols of power and authority, especially when they are keys to a royal palace, the gates of a walled city, or the keys to a prison.
Some sins become so habitual that they have the nature of imprisonment — consider the alcoholic or the compulsive and impoverished gambler: no longer do they get joy from drink or from the games. Rather they ruin their lives because they have little remaining choice in the matter: their vices compel them, like a slave is compelled by his master.
According to the prophets, the Messiah is the key which can unbind those imprisoned by sin, and which unlocks the gates to the kingdom of Heaven. Note how Christ gave the keys of the kingdom to Peter, who with the Apostles has the power to “bind and loose”, a reference to the chains which bind those in sin.
American culture often depicts Saint Peter as up in the clouds next to the pearly gates; this is boring at best. Rather, the Catholic view is that Peter — and his successors — have the keys to the kingdom in the here and now and not just the hereafter.