How this good follows from the gift of prophecy is mentioned when he says: the secrets of his heart. This can be understood in three ways: in one way, and this is literal, that some in the early Church had the grace to know the secrets of the heart and the sins of men. Hence it said of Peter (Ac 5:1 ff) that he condemned Ananias for fraud regarding the price of a field. And according to this it says: for the secrets of his heart are disclosed. As if to say: He is convinced, because the secrets, i.e., his secret sins, were disclosed by those who revealed them. In another way, from the fact that... sometimes someone in preaching touches on many things which men carry in the heart, as is clear from the books of Gregory, where each one can find almost all the movements of the heart. And according to this he says, secrets of his heart; as if to say: They are convicted, because the secrets of their heart, i.e., things they carry in their heart: (Pr 27:19): "As in water face answers to face, so the mind of man reflects the man," are disclosed, i.e., touched on by them. In another way, because sometimes the secret of the heart is said to be that which is doubtful to someone and he cannot become certain by himself. According to this it is read: the secrets of his heart, i.e., things about which he doubted in his heart and which he did not believe, are disclosed, namely, when going to a church frequently they are made clear to him, as Augustine says about himself that he went to the church only for the chant and yet many things about which he doubted and for the sake of which he had not come were clarified for him there. For from this followed reverence, because, being convinced, he revered God.
And this is what he says: and so, i.e., inasmuch as he was convinced in this way and the secrets of his heart were manifested, falling on his face, he will worship God: "Falling down, they adored him" (Matt 2:11), which is a sign of reverence. Of the reprobate, however, it says that they fall backward: "The way of the wicked is deep darkness, they do not know over what they stumble" (Pr 4:19). But the elect fall on their face, because they see where they should prostrate themselves, which is a sign of reverence. "They praised God and fell on their faces" (Lev 9:24); "May all kings fall down before him" (Ps 72:11). And he will show reverence not only to God but also to the Church, because he will declare that God is really among you who prophesy in the church: "We will go with you, for we have heard that God is with you" (Zech 8:23). It appears, therefore, that the gift of prophecy is more useful in regard to unbelievers.
Source: Commentary on 1 Corinthians