In this story/parable of the ten virgins told by the Messiah Y'shua/Jesus, to understand the meaning of this we first need to understand the context in which it was written. Y'shua/Jesus is a Jewish Rabbi that is telling this story, teaching His Jewish students or disciples/Talmudim. So the story would be understood from a Hebraic or Jewish understanding. This is the only way this story can be understood.
This story is a very serious, alarming warning for all that follow the Messiah of Israel, Y'shua/Jesus. When Y'shua says ," the Kingdom of Heavens will be like, in essence He is saying this is how it will be when the Kingdom of Heavens appears, or when it is established here on earth, eternal life. The virgins in this story are all who are believers of Y'shua/Jesus, who have been washed by His blood and by their testimony, so they are pure, virgins. But we have five wise and five foolish virgins. In the Psalms we find in chapter 111.10 Reverence for the LORD is the beginning of wisdom: a good understanding have all those who do His commandments. His praise endures forever.112.1 HalleluYah! Blessed is the man who reveres the LORD, who delights greatly in His commandments. In this story the wise virgins are those who revere The Almighty LORD, and keep His commandments, or HIS Torah. We need to know that Torah means "teaching". So even though they fall asleep they are ready for they have prepared themselves with the LORD's Torah/teaching. One thing to note, observing Torah/teaching does not redeem anyone, but it does make one wise, and prepared for the return of our Redeemer. Y'shua/Jesus is the "Light of the world", believers are His light bearers, or lamps. So we see the wise virgins have lamps, they belong to Messiah, they have oil, they observe His Torah(commandments), so they are prepared for the Bridegroom, which is the Messiah Y'shua/Jesus. Not so for the foolish virgins, they are believers for they have a lamp, but no oil, they do not observe His Torah(commandments). They are not ready/prepared for the bridegroom. They do not have an intimate knowledge, relationship with Y'shua/Jesus.
Then in the middle of the night a cry! This teaches us this world will be at it's darkest hour when the Messiah Y'shua/Jesus returns, Y'shua teaches us in Matthew 24:12 , because of lawlessness, or Torahlessness, the love of many will grow cold. This world we live in will abandon the Torah, GOD's teachings, HIS Way of life. Y'shua told us, He is The Way, The Truth, The Life. John 14.6 The Way He is speaking is Torah, He is the living Torah! But at this world's darkest hour He will return! The cry is the blast of GOD's Shofar, beloved will you be ready when all the world hears this trumpet sound?
When the bridegroom comes, the wise virgins trim their lamps and they come to meet their beloved bridegroom, and enter into the bridal chamber, for they were prepared! They built a relationship with Him because they kept His Torah/teachings, they became intimate with Him. Then the bridal chamber doors were locked! The foolish ones went to buy some oil. Beloved you can't buy Torah, it is freely given to those who seek with all their heart, all their being, all their strength. Deut. 6.4-9 The foolish ones went to buy the oil of false teaching. When they did arrive at the door it was locked, they cried out Lord, Lord! You must open to us now! But Y'shua/Jesus tells them, "Truly I say to you, I do not know you." He never new them because they never devoted themselves to His teaching in Torah, in turn getting to know Him intimately. This is a very stern warning we have in these Last Days! So continually be Watchful, because you do not know the Day or the Hour!
I need to add, Torah is summed up in the Love of GOD. In the Love chapter of 1 Corinthians 13, love is summed up by the very character of GOD. Torah/teaching reveals the very essence of who GOD is. Love is seeking justice for the fatherless, the homeless, the widow, the hungry, the sick, the one in prison, the stranger, the one who cannot defend themselves, etc...we are our brothers keepers. This is following Torah, this is, and always will be the Torah/teaching of the GOD of Abraham, Isaac, and Jacob. Eternal. Let us all strive to learn this and do this. In service of the King, All Glory to HIM!
Shalom.