I didn't really want to get into it because it's obviously a very complicated topic and I feel that other responses online will give you a better explanation, but I always got the impression that Jesus was not portrayed as "knowing all" while He was alive. He followed the same path as other people, learning, being tempted, etc., so while He was the Son of God and had God's spirit/divinity in doing the right thing, that didn't mean He suddenly had access to all the knowledge of God. Now as for after His time on Earth when He ascended to Heaven, that might be another matter. (Not saying my own beliefs, just as I understand it.) I think getting overly literal is a real problem with Christianity today and is one of the reasons it's looked at so poorly by people who can't buy into that interpretation, but the latter group don't stop to think of it in symbolic terms, which is really how a lot of it was meant, and that is also a mistake because they end up throwing out the baby with the bathwater. (Older versions of Christianity, e.g., Orthodox, are less literal.)