The effective call from God to those He has chosen caused the sheep to believe in the Lamb of God to take away their sin.
The goats are those who believe not. John 3:18 “He that believeth on him is not condemned: but he that believeth not is condemned already, because he hath not believed in the name of the only begotten Son of God.”
From Rev 20:
“11 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.
12 And I saw the dead, small and great, stand before 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.
13 And the sea gave up the dead which were in it; and death and hell delivered up the dead which were in them: and they were judged every man according to their works.
14 And death and hell were cast into the lake of fire. This is the second death.
15 And whosoever was not found written in the book of life was cast into the lake of fire.”
What I find so interesting and easy to over look is it is the other books that have the works in them. The book of life only has names, not works.