In God there exists the most perfect knowledge.
That is to say, God knows everything there is to know.
To prove this, we must note that intelligent beings are distinguished from non-intelligent beings in that the latter possess only their own form...
First, it must be noted what "form" means here. It does not simply mean "shape." It means rather the structure and organization of a thing. A hunk of marble could be in the shape of an elephant, but it would not have the form of an elephant. In order to have the form of an elephant, a lump of matter must also have all the structure and organization that goes along with that, such as organs that take in nutrients, a trunk that spits water, and it must be caused by another elephant. The "form" of something means something like "what the thing is" or "the definition of a thing."
A non-intelligent thing then, like a rock, only has its own form. The form of a rock, in this case. A rock does not also have the form of a tree, otherwise it would be a tree. But if it were a tree, it wouldn't be a rock. A tree could die, become soil, and then become a rock over time. But being non-intelligent, it can only possess one form at a time. So non-intelligent things can only have one form at a time: whatever that thing currently is.
...whereas the intelligent being is naturally adapted to have also the form of some other thing, for the idea of the thing known is in the knower.
Intelligent beings can have the forms of other things in their minds. When you think about rocks, the form of rock is in your mind. After you think about rocks, you can think about trees. Or you can think about trees and rocks at once. The form of rocks and trees can both be in your mind. The mind is unique in that it can, unlike non-intelligent things, possess more than one form at a time.
Hence it is manifest that the nature of a non-intelligent being is more contracted and limited...
This is essentially just a restatement of the above. Non-intelligent things can only have one form at a time, and are therefore limited in that sense.
...whereas the nature of intelligent beings has a greater amplitude and extension; therefore the Philosopher says (De Anima iii) that "the soul is in a sense all things."
And intelligent beings are less limited, because they can have more than one form at a time in their minds and hence the mind is, in a sense, "all things", as Aristotle says.
Now the contraction of the form comes from the matter. Hence, as we have said above (Question 7, Article 1) forms according as they are the more immaterial, approach more nearly to a kind of infinity.
Again, the reason a thing is limited in this sense is that it is material. If it is material, it can only be organized and structured one way, not multiple different ways simultaneously. But if something is free from matter, it is intelligent precisely because it can now have multiple forms simultaneously. The more free from matter something is, the more intelligent it is.
Therefore it is clear that the immateriality of a thing is the reason why it is cognitive
Being free from matter is the reason why something is intelligent. Because matter is by nature only able to have one form at a time, and a mind is able to have multiple forms at a time.
...and according to the mode of immateriality is the mode of knowledge.
The more free from matter something is, the more forms it can have at once, and hence the more intelligent it is.
Hence it is said in De Anima ii that plants do not know, because they are wholly material. But sense is cognitive because it can receive images free from matter, and the intellect is still further cognitive, because it is more separated from matter and unmixed, as said in De Anima iii.
So we have a gradation, from completely material things like plants that are non-intelligent, to things that have sensory apparatus, up to intelligent things that can have multiple forms at once and are therefore somewhat free of matter.
Since therefore God is in the highest degree of immateriality as stated above (Question 7, Article 1), it follows that He occupies the highest place in knowledge.
First, as proven earlier in the Summa, God is immaterial because he is the unchanging changer, and matter is changeable. So the unchanging changer (God) must be immaterial.
Since God is completely immaterial, he can therefore have multiple forms at once, indeed all forms at once, and is therefore completely intelligent.