27 “And one of them, [named] Caiaphas, being the high priest that same year, said unto them, You know nothing at all, nor consider that it is expedient for us that one man should die for the people, and that the whole nation perish not. And this spoke he not of himself; but being high priest that year, he prophesied.” We are here taught that the Spirit of prophecy used the agency even of wicked men to foretell what was future; which, however, the evangelist attributes to the divine sacramental fact that he was pontiff, which is to say, the high priest.
It may, however, be a question in what way he is called the high priest of that year, seeing that God appointed one person to be high priest, who was to be succeeded only at his death by another. But we are to understand that ambitious schemes and contentions among the Jews led to the appointment afterwards of more than one, and to their annual turn of service. For it is said also of Zacharias: “And it came to pass that, while he executed the priest's office before God in the order of his course, according to the custom of the priest's office, his lot was to burn incense when he went into the temple of the Lord.” From which it is evident that there were more than one, and that each had his turn: for it was lawful for the high priest alone to place the incense on the altar. And perhaps also there were several in actual service in the same year, who were succeeded next year by several others, and that it fell by lot to one of them to burn incense.
What was it, then, that Caiaphas prophesied? “That Jesus should die for the nation; and not for the nation only, but that also He should gather together in one the children of God that were scattered abroad.” This is added by the evangelist; for Caiaphas prophesied only of the Jewish nation, in which there were sheep of whom the Lord Himself had said, “I am not sent but unto the lost sheep of the house of Israel.” But the evangelist knew that there were other sheep, which were not of this fold, but which had also to be brought, that there might be one fold and one shepherd. But this was said in the way of predestination; for those who were still unbelieving were as yet neither His sheep nor the children of God.
Source: Tractates on the Gospel of John (New Advent)