Then when he says, his disciples did not understand this at first, he describes the state of mind of the disciples regarding this prophecy. And he admits his own ignorance and that of the disciples, for as we read: "The just person is the first to accuse himself" (Prv 18:17). So he says, his disciples did not understand this, what was predicted, at first, that is, before the passion. But when Jesus was glorified, i.e., when he showed the power of his resurrection, then they remembered that this had been written of him and had been done to him. The reason they knew only after he had been glorif...ied was because it was then that they received the power of the Holy Spirit, which made them wiser than all the wise: "The breath of the Almighty makes a man understand" (Job 32:8).
Source: Commentary on John