Next (v 5), our Lord explains what he has just said: first, we see the occasion for this explanation; secondly, the explanation itself (v 6).
The occasion for this explanation was the hesitation expressed in the question of Thomas. Lord, we do not know where you are going; how can we know the way? Here Thomas denies the two things that our Lord affirmed. For our Lord said that they knew both the way and its destination; but Thomas denied that he knew the way and its destination. Yet both statements are true: for it is true that they knew, yet they did not know that they knew. For they knew ma...ny things about the Father and the Son which they had learned from Christ; yet they did not know that it was the Father to whom Christ was going, and that the Son was the way by which he was going. For it is difficult to go to the Father. It is not surprising that they did not know this because although they clearly knew that Christ was a human being, they only imperfectly recognized his divinity: "That path no bird of prey knows" (Job 28:7).
Thomas says, how can we know the way? Knowledge of the way depends on knowledge of the destination. And so because we do not know the destination - "He dwells in unapproachable light, whom no man has ever seen or can see" (1 Tim 6:16) - we can not discover the way: "How inscrutable his ways!" (Rom 11:33).
Source: Commentary on John