Answer: The parable of the ten virgins is found in chapter 25 of the book of Matthew. The other three gospels, surprisingly, do not record it.
The parable, as told by Jesus, revolves around ten virgins. In the middle of the night they are notified that they must rise up and go to the approaching bridegroom. All ten bring their lamps in order to see in the darkness, but only five of the women (referred to as being wise) bring extra oil for their journey (Matthew 25:2). The other five ladies (the foolish virgins) take what little oil remains in their lamps and nothing more (verse 3).
And the foolish (five of the ten virgins) said to the wise, 'Give us some of your oil, because our lamps are going out.' But the wise answered, saying, 'No, lest there not be enough for us and for you. But instead, go to those who sell . . .' (Matthew 25:8 - 9, HBFV throughout).
What causes five out of the ten virgins to lack enough oil in their lamps? What does the "oil" here represent? Can God instantly impart spiritual wisdom and truth into people's minds?
All the ten virgins in the parable represent truly converted people that exist before Jesus' second coming. They are not those who do not have a relationship with God. What, then, keeps five of them out of God's kingdom? It was not the lack of spiritual wisdom or knowledge per se, but the lack of God's precious spirit, which imparts spiritual wisdom and knowledge to believers.
At least two Biblical verses correlate physical oil with the Holy Spirit. Consider first Isaiah 61:1, which Jesus later referred to concerning his fulfilling of it by His ministry (Luke 4:18, 20).
The Spirit of the Lord GOD is upon Me (in order to fulfill prophecy) because the LORD has anointed Me to preach the Gospel (or good news) to the poor . . . (Isaiah 61:1)
Notice how the oil for formally appointing a king of Israel is functionally equated with the Spirit of the Lord. This relates to the fact that the title "Messiah" or "Christ" means "The Anointed One." Although Jesus had had the Holy Spirit from the time He was conceived in the Virgin Mary's womb (cf. Luke 1:35, 41), he also received the Holy Spirit after being publicly baptized (Luke 4:21 - 22), which is how He became anointed. Likewise, consider what happened right after Samuel anointed David king of Israel.
And Samuel took the horn of oil and anointed him (David) . . . And the Spirit of the Lord came upon David (1Samuel 16:13)
In this light, the five of the ten virgins who did not enter the kingdom ran low on the Spirit (i.e., the metaphorical "oil" in their lamps), which is the power through which they receive spiritual knowledge and wisdom from the Eternal. Paul makes this function of the Holy Spirit clear in 1Corinthians chapter 2.
The ability to "buy," or ask God to provide an understanding of his truth and the character it produces, is not a foreign concept in the Bible. King Solomon admonished his readers, in the book of Proverbs, to buy the truth, along with wisdom and understanding, if they had to (Proverbs 23:23).
The meaning of the parable of the ten virgins teaches us that, shortly before Christ's return, there will be Christians who are so slack in their spiritual duties that they will not have enough of God's Spirit (character) in order to endure to the end (Matthew 24:13). All true Christians should make sure they have the faith and are diligent enough in their spiritual lives not to be caught unprepared (Matthew 24:45 - 51). We must all strive to be wise, and not foolish, virgins.