Then when he says, and if I have prophecy, he shows the same about things pertaining to knowledge. But it should be noted that above he proposed four charismatic graces pertaining to knowledge, namely, wisdom, knowledge, faith and prophecy. He begins here with prophecy, saying, if I have prophetic powers, through which secrets are divinely revealed, as it says in 2 Pt (1:21): "No prophecy every came by the impulse of man, but men moved by the Holy Spirit spoke from God." Secondly, as to wisdom, he adds: and understood all mysteries, i.e., the secrets of the divinity which pertains to wisdom, a...s it says above (2:7): "We impart a secret and hidden wisdom of God." Thirdly, as to knowledge as he says: and all knowledge, whether humanly acquired as by the philosophers or divinely infused as in the apostles: "It was he who gave me unerring knowledge of what exists" (Wis 7:17). Fourthly, as to faith he adds: and if I have all faith so as to remove mountains. It is possible to explain all faith as all the articles; but it is useful to explain all, i.e., perfect faith on account of what is added: as to remove mountains. For it says in Matt (17:20): "If you have faith as a grain of mustard seed, you will say to this mountain, 'Move hence to yonder place,' and it will move." And although a grain of mustard seed is very tiny, it is not considered tiny, but perfect faith is compared to a grain of mustard seed: "If you have faith and never doubt, you will not only do what has been done to the fig tree, but even if you say to this mountain, 'Be taken up and cast into the sea,' it will be done" (Matt. 21:21). Faith, therefore, which does not doubt is compared to a grain of mustard seed, which, the more it is rubbed, the more its strength is sensed.
But some object that although many saints had perfect faith, no one is recorded to have moved mountains. This is solved by what is said above (12:7): "To each is given the manifestation of the Spirit for the common good," i.e., in that time, place and manner miracles are worked by the grace of the Holy Spirit as the needs of the Church require. But many saints have done much greater things than moving mountains, according as it was useful to the faith: for example, by raising the dead, dividing the sea and performing other works of this nature. And they would have done this, if it had been necessary. This can also be referred to the expulsion of demons from human bodies, who are called mountains on account of pride: "Before your feet stumble on the twilight mountains, I am against you, O destroying mountain, which destroys the whole earth" (Jer 13:16). The working of miracles is attributed to faith that does not doubt, because faith rests on omnipotence, through which miracles are performed.
If, I say, I had all the above pertaining to the perfection of the intellect, and have not charity, through which the intellect is perfected, I am nothing, according to the order of grace, about which it says in Eph (2:10): "For we are his workmanship, created in Christ Jesus for good works." Hence Ez (28:19) says against someone: "You have come to a dreadful end, and shall be no more forever." This occurs on account of a lack of charity, however, its use is not good. Hence it says above (8:1): "Knowledge puffs up, but charity builds up."
But it should be noted that the Apostle speaks here about wisdom and knowledge as they pertain to the charismatic gifts, which cannot be without charity. For accordingly as they are numbered among the seven gifts of the Holy Spirit, they are never possessed without charity. Hence, Wis (1:4) says: "Wisdom will not enter a deceitful soul," and Wis (10:10): "She gave him the knowledge of holy things." As far as prophecy and faith are concerned, it is clear that they cannot be possessed without faith. But it should be noted here that strong faith, even without charity, can perform miracles. Hence, Matt (7:22): "Did we not prophesy in your name and do many mighty works in your name?" The answer is given: "I know you not." For the Holy Spirit works wonders even through the wicked, just as He speaks the truth through them.
Source: Commentary on 1 Corinthians