66 The Lord Jesus Christ, then, Who searches the heart and the reins, has no weakness in His nature, that He should not know, for, as we perceive, even the fact of His ignorance proceeds from the omniscience of His nature. Yet if any there be, who impute to Him ignorance, let them tremble, lest He Who knows their thoughts should say to them, Wherefore think ye evil in your hearts ? The All-knowing, though not ignorant of thoughts and deeds, sometimes enquires as if He were, as for instance when He asks the woman who it was that touched the hem of His garment, or the Apostles, why they quarrelled among themselves, or the mourners, where the sepulchre of Lazarus was: but His ignorance was not ignorance, except in words.
It is against reason that He should know from afar the death and burial of Lazarus, but not the place of his sepulchre: that He should read the thoughts of the mind, and not recognise the faith of the woman: that He should not need to ask concerning anything, yet be ignorant of the dissension of the Apostles. But He, Who knows all things, sometimes by a practice of economy professes ignorance, even though He is not ignorant. Thus, in the case of Abraham, God concealed His knowledge for a time: in that of the foolish virgins and the workers of iniquity, He refused to recognise the unworthy: in the mystery of the Son of Man, His asking, as if ignorant, expressed His humanity.
He accommodated Himself to the reality of His birth in the flesh in everything to which the weakness of our nature is subject, not in such wise that He became weak in His divine nature, but that God, born man, assumed the weaknesses of humanity, yet without thereby reducing His unchangeable nature to a weak nature, for the unchangeable nature was that wherein He mysteriously assumed flesh. He, Who was God is man, but, being man, has not ceased to remain God. Conducting Himself then as one born man, and proving Himself such, though remaining God the Word, He often uses the language of man (though God, speaking as God, makes frequent use of human terms), and does not know that which it is not yet time to declare, or which is not deserving of His recognition.
Source: On the Trinity (New Advent)