The connection is as follows: these people, who speak evil of you, will give an answer to Him who judges all the living and the dead. The dead are also judged. This is evident from the Lord's descent into Hades. For, having appeared there after His death on the cross, He preached there as well, just as on earth — He preached not by word, but by deed. And just as His sojourn in the world served as justification for those who readily acknowledged Him, and as condemnation for those who did not acknowledge Him, so also among those held in Hades, to those who had lived according to the flesh He app...eared for condemnation, while to those who had lived according to the spirit — that is, who led a spiritual and virtuous life — He appeared for glory and salvation. Therefore He is rightly called the Judge of the living and the dead. St. Cyril explains it differently. By "the dead" here he means those among the pagans who had put themselves to death through the sins named above (in verse 3), about whom the apostle also prays that they would turn back and give an irreproachable answer to Him who is to judge the living and the dead. By "the living and the dead" he also means the righteous and the sinners, to whom God the Word, having appeared in the flesh, proclaimed the good news of the Kingdom of Heaven. Those sinners who accepted His commandments judge themselves as men in the flesh — that is, they condemn their flesh in this present human life to fasting, prostrations on the ground, tears, and other hardships — so as to live according to God in the spirit, being inspired in this by the saying of the apostle: "though our outward man perishes, yet the inward man is renewed day by day" (2 Cor. 4:16).
Source: Commentary on 1 Peter