Jacob is aware of Nephi’s prophecy that the Nephites would be destroyed, but that the Lamanites would remain. That prophetic knowledge undergirds this part of the discussion. The essential prophecy is in verses 4 and 6, where verse 4 indicates that the Lamanites will possess the Nephite lands, and verse 6 promises that the Lamanites will not be destroyed, but will one day be redeemed—will “become a blessed people.”
Nevertheless, Jacob appears to be referencing something long before the end of the Nephites in a thousand years. The most likely reference is to the dispersal of the Nephites out of the land of Nephi and into the land of Zarahemla under the reign of Mosiah (father of Benjamin). Thus, verse 4 notes that “the Lord God will lead away the righteous out from among you.
The immediate point is contained in verse 5. Jacob reiterates that the Lamanites are the outsiders, and that they are hated. The expectation that the Nephites are good and the Lamanites are bad is upended when Jacob declares that they “are more righteous than you.” The reason has to do with the marriage law Lehi gave his children; they are to have no more than one wife. The Lamanites are living that law. Clearly, some of the Nephites are not.
See the comments on 2 Nephi 5:20-21 for a short discussion of the skin of blackness. Jacob refers to the cursing of the Lamanites, and notes that the curse came upon their skins. In Jacob, there is no reference to pigmentation, just to the curse. Interestingly, one of the elements of the curse was that they were to be a scourge to the Nephites, a threat that Jacob has reiterated in verse 3.