SCRIPTURE COMMENTARY #500
"And I will pray the Father, and he shall give you another Comforter, that he may be with you for ever, even the Spirit of truth: whom the world cannot receive; for it beholdeth him not, neither knoweth him: ye know him; for he abideth with you, and shall be in you.
But the Comforter, even the Holy Spirit, whom the Father will send in my name, he shall teach you all things, and bring to your remembrance all that I said unto you." (John 14:16-17; 26)
THE INFALLIBILITY OF THE CHURCH: Our Lord knew well that the apostles did not fully understand what He taught them, and He knew moreover that, owing to the weakness of human nature, much that He had taught them would, in the course of time, be forgotten, without the aid of a higher and supernatural assistance. He therefore promised to send the Holy Ghost, the Spirit of Truth, to abide with the apostles, to teach them all things, and to bring to their remembrance all that He had said to them. This Spirit of Truth was to abide with them "for ever"; but as the apostles were not to live for ever on this earth, the promise was not meant to apply only to them individually, but to their successors, the Popes and Bishops of the Church. The Spirit of Truth which, according to the promise, abides for ever in the Church, preserves intact in her the Truth taught by Jesus Christ, keeps her from error, and therefore renders the Church infallible.
[From 'A Practical Commentary on Holy Scripture' by Bishop Knecht, D.D.]
(1899 Douay-Rheims Bible)