Yesodei HaTorah 2:9
Everything in the universe aside from God Himself was brought into existence by Him. Since He knows Himself, He is aware of His own His greatness. God knows all and nothing is hidden from Him.
Yesodei HaTorah 2:10
God knows the truth of His Own Being. His knowledge is not something external and separate to Him the way that ours is, since we and our knowledge are not identical. Rather, God, His knowledge and His life are all identical in absolute unity. If God were to live as humans do, or to know with a knowledge that is separate from Him as humans do, then there would be multiple gods: Him, His life, and His knowledge. This, however, is not the way things are. Rather, God is one absolute unity. One could say the He is the One Who knows, the subject of that knowledge, and the knowledge itself all in one.
This matter is beyond human ability to grasp in its entirety. Regarding humans, Tanach says “chay Paroh” (“by Pharaoh’s life” – Genesis 42:15) and “chay nafsh’cha” (“by the life of your soul” – I Samuel 25:26). [“Chay” – rhymes with “May” – is written with a tzeirei – the “two dots.”] Regarding God, however, it says “chai Hashem” – “As God lives.” This is because human lives – and even the lives of angels – are separate from their beings, but God and His life are identical.
Therefore, God does not know creation externally as we know do. Rather, He knows everything intrinsically, as part of Himself. Accordingly, since He knows Himself, He knows all, as the existence of everything in the universe is dependent on Him.