God alone can know the thoughts of hearts and affections of wills. The reason of this is, because the rational creature is subject to God only, and He alone can work in it Who is its principal object and last end. Consequently all that is in the will, and all things that depend only on the will, are known to God alone. Now it is evident that it depends entirely on the will for anyone actually to consider anything; because a man who has a habit of knowledge, or any intelligible species, uses them at will. Hence the Apostle says (1 Corinthians 2:11): “For what man knoweth the things of a man, but the spirit of a man that is in him?”
A secret thought can however be known in two ways: first, in its effect. In this way it can be known not only by an angel, but also by man; and with so much the greater subtlety according as the effect is the more hidden. For thought is sometimes discovered not merely by outward act, but also by change of countenance; and doctors can tell some passions of the soul by the mere pulse.