From Revelations of the Restoration, p. 1029:
As used in scripture, hell has reference to the place of departed spirits (Bible Dictionary, 699). In some passages, though certainly not all, it refers to the place of torment or the abiding place of wicked spirits. The point of this passage of scripture is that the keys being promised to Peter will have power to open such gates. A gate prevails when it keeps something in our out of a particular place. For keys to prevail is for them to either lock or unlock such a gate so that people can enter or leave the gated area.
Those who obey the laws and ordinances of the gospel have the promise that the gates of hell shall not prevail against them (D&C 10:69, 17:8, 21:4-6; 98:22). This is generally thought to mean that they are safe from the threat of ending up in the place of torment when they die. it is also generally supposed that in the context of the present text it is saying that hell or the devil will not prevail against Peter. In face, what is being said is that Peter will have power to direct the ministering of the gospel in the world of the spirits and that he, and for that matter all faithful Saints acting under his direction, will have the power to move freely from one part of the spirit world to another.
Was your mind just blown? Mine was. Priesthood keys = ability to preach to and do ordinances for spirits in prison (i.e. hell) = gates of hell can't prevail against the work of the Church, which is saving souls. Here is more from Harold B. Lee in "Preparing to Meet the Lord," Improvement Era 68:122, Feb. 1965:
Because the keys of the priesthood which were restored to the Prophet Joseph Smith the gates of hell did not prevail against the church of Jesus Christ, notwithstanding the Great Apostasy. through the saving ordinances of the gospel, work could be done for the millions who died between the time of the Church of Jesus Christ inthe first century AD and the restored Church of Jesus Christ, AD 1830.
There is a vital responsibility given to him who holds the keys, all the keys that pertain to the kingdom, even the President of the Church in each dispensation. The Lord said that in a great revelatoin. To Peter, the Master said, "And I will give thee the keys of the kingdom of heaven: and whatsoever thou shalt bind on earth shall be bound in heaven: and whatsoever thou shalt loose on earth shall be loosed in heaven." (Matt. 16;19) He also said that the gates of hell should not prevail against Christ's Church. (see ibid. 16:18) Now, the gates of hell would have prevailed against the Lord's work if there hadn't been given the ordinances pertaining to the salvation of those who are dead. During those periods when the priesthood to perform the saving ordinances of the gospel was not upon the earth, there were millions who lived, many of whom were faithful souls. If there hadn't been a way by which the saving ordinances of the gospel could be performed for those who thus died without the knowledge of the gospel, the gates of hell would have prevailed against our Father's plan of salvation.