Human knowledge is receptive: we come to know things by being affected by them, by receiving their forms through sensation and abstraction. Divine knowledge is the opposite: God does not learn from things but knows things by knowing himself as their cause. The divine intellect is not perfected by its objects; it is the source of the perfection of its objects. God knows every creature not by turning attention to it but by knowing the creative act by which it is and the divine essence in which it participates.
The key to how God knows future contingents without determining them is Aquinas's doctrine of eternity. God does not exist in time as an everlasting being who remembers the past and anticipates the future; God exists in a single timeless now that is equally present to all moments of time. From the standpoint of eternity, the entire temporal sequence is simultaneously present — as if an observer could see at a glance what a sequence of travellers see only one by one. God sees Caesar crossing the Rubicon and the Last Judgement together, neither before the other, both in a single eternal act.
This account allows Aquinas to hold that God knows infallibly what a human being will freely choose without that knowledge being the cause of the choice. God's eternal vision does not look ahead from a vantage point earlier in time; it is co-present with the very act of choosing as the act occurs. The free choice remains free — caused by the agent's own will, not compelled by God's foreknowledge. The difficulty of the position is not a failure of logic but a sign that divine knowledge exceeds the categories available to creatures who experience only one moment at a time.
Disputed Questions on Truth, Questions 2–3, treat God's knowledge and the divine ideas. The temporal argument is restated in Summa Theologiae I, Q.14, Art.13. Aquinas acknowledges the problem does not admit of complete comprehension by a finite intellect.