Then follows the petition of the foolish: and the foolish said to the wise: give us of your oil, for our lamps are going out. These were foolish in some respect and in some respect not, because they had something of the light of faith; hence they say: for our lamps are going out. For if they had nothing of faith, they would say "are gone out"; hence they recognize that they cannot preserve fire without oil. And what does this mean? Whether oil is understood as the work of mercy or of justice, the sense is the same, because those rising who do not have these works in abundance seek to have thei...r deficiencies supplied by those who had them more abundantly. But this cannot be done, because each will need his own; Galatians 6:5: every man shall bear his own burden. And because they saw that the light of faith could not avail without the work of mercy, they sought from others who had done works of mercy. Augustine expounds it thus. It is customary that when someone is overtaken in something, he tends to have recourse to that in which he hopes; these had their confidence outwardly, because they sought the praise of others; hence they say: give us of your oil, i.e., of your praise, i.e., praise us for our work. But this will not avail them, according to what is had in Romans 2:15: their conscience bearing witness to them; Job 16:20: behold my witness is in heaven, and he that knows my conscience is on high. Hence they trust in human favor, which cannot profit them. According to Origen it happens that some have spent their life in vain things: and when they recognize this, they have recourse to others and seek their prayers and benefits. And in this they are not foolish if they begin to return to the Lord.
Source: Commentary on Matthew