The Ten virgins are a type for the church, a parable that says, you need truth, in order to know the difference between the false Christ and the True Christ. The 5 foolish didn't have truth, and when the time came for the True, Bridegroom to arrive, they were shut out. Basically, because they were found with child . Meaning they were Not faithful to the True Christ; but rather, they fell for the deception of the fake.
Matthew 25:11-13 is connected with Matthew 7:21–23.
Matthew 25:11-13: “Afterward the other virgins came also, saying, ‘Lord, Lord, open to us!’ But he answered and said, ‘Assuredly, I say to you,
I do not know you.’
“Watch therefore, for you know neither the day nor the hour in which the Son of Man is coming"
Matthew 7:21-23: "Not everyone who says to Me, ‘Lord, Lord,’ shall enter the kingdom of heaven, but he who does the will of My Father in heaven. Many will say to Me in that day, ‘Lord, Lord, have we not prophesied in Your name, cast out demons in Your name, and done many wonders in Your name?’
And then I will declare to them, ‘I never knew you; depart from Me, you who practice lawlessness!’
The connection between these two scriptures are those very words "I never knew you" so clearly these people were never saved. They may have called themselves Christians but they were never saved by the blood of Jesus. They were false believers.
One day it will be too late. The door to salvation will one day be closed. Just like the virgins that knocked on the door asking Him to open it and His reply was "I do not know you".
John 10:7-10: "Then Jesus said to them again, “Most assuredly, I say to you,
I am the door of the sheep. All who
ever came before Me are thieves and robbers, but the sheep did not hear them.
I am the door. If anyone enters by Me, he will be saved, and will go in and out and find pasture. The thief does not come except to steal, and to kill, and to destroy. I have come that they may have life, and that they may have
it more abundantly"
Likewise, in the past - the door to the ark was eventually closed and then God's wrath was poured out on the people that didn't believe.