No study or discussion of salvation is complete without considering JUDGMENT. Judgment is misunderstood by most people. Few realize that there are multiple judgments. Most also fail to realize that rather than the usual court or trial situation, judgment also refers to the rendering of justice or the reward (good or bad). At the moment we are only discussing court (trial) decisions.
Judgment by Faith
And shall come forth; they that have done good, unto the resurrection of life; and they that have done evil, unto the resurrection of damnation. John 5:29
These are the two resurrections separated by a thousand years, leading to two different judgments.
The first judgment (salvation by faith) is only for those who have the faith of Yahweh, the overcomers, the barley, the wise virgins. They are saved by the faith of Yahweh, the only name that can save. This first judgment and resurrection takes place at the second coming of Jesus the King in the clouds - at the beginning of the millennium. These faithful, saved by faith, are the Barley harvest and this is the first and better resurrection. It isn't time yet for the wheat and grape harvest and the white throne judgment and resurrection. Those come later.
Blessed and holy is he that hath part in the first resurrection: on such the second death hath no power, but they shall be priests of God and of Christ, and shall reign with him a thousand years. Revelation 20:6
Judgement by Works
After the 1000 year millennium, Heaven descends to this Earth as the new Jerusalem. Then comes the Great White Throne judgment. This will be the judgment of the wheat (foolish virgins) and the grapes (the wicked). This judgment is based on works because the faith of Yahweh is absent, otherwise, they would have been saved at the 2nd coming judgment and first and better resurrection.
And I saw a great white throne, and him that sat on it, from whose face the earth and the heaven fled away; and there was found no place for them. And I saw the dead, small and great, stand before יהוה [Yahweh, our god]; and the books were opened: and another book was opened, which is the book of life: and the dead were judged out of those things which were written in the books, according to their works. Revelation 20:11-12