The question has been posed, as to if humans can have a free will in a system in which the creator knows the outcome of every event, has long been argued by theologians. As stated by Boethius "There seems to be an hopeless conflict between divine foreknowledge of all things and freedom of human will. For if God sees everything in advance and cannot be deceived in any way, whatever his Providence foresees will happen, must happen. Therefore, if God foreknows eternally not only the acts of men, but also their plans and wishes, there cannot be freedom of will…."
The other avenue that one can take is that God knows the outcome but does not act to cause the outcome. But the crux of the problem is "Since as we have shown, whatever is known is known according to the nature of the knower, and not according to its own nature, let us now consider as far as is lawful the nature of the Divine Being…." Boethius goes on to define eternal. He is close to the answer at this point but lacks an understanding of his Bible.
Before we can answer this question first we must understand the Divine nature from what has been given to us in the pages of the Bible. The New Testament book of Romans, in chapter 1, verse 20 we are told "For since the creation of the world His invisible attributes, His eternal power and divine nature, have been clearly seen, being understood through what has been made..."
What in nature was created which tells us of Gods Divine nature? Back in the very beginning of the Bible the question is answered. In the book of Genesis, in chapter 1 and verse 26, we are told, "Then God said, 'Let us make man in our own image, according to our likeness…'." We are the part of creation, which is like God. What is our nature as created by God? In the book of Genesis, chapter 2, verse 7 we are further told, "The LORD God formed man of the dust from the ground, and breathed into his nostrils the breath of life, and man became a living soul." This nature of design is echoed in many other places, for example in 1 Thessalonians chapter 5, verse 23 we find, "sanctify you entirely; and may your spirit and soul and body be preserved complete…" God made a body out of the matter of the earth or the elements of the physical 4 dimensions of time and space, placed into it a spirit (the Hebrew word breath is the word for spirit) and man became a living soul. Not has a soul, but is a living soul.
What is the meaning of these words in modern language? Spirit is nature or personality. Soul is mind. We created in modern years a device in our image, not likeness yet. It is the computer. The hardware is body, made of the elements of the earth. In this hardware we place software, information called operating system and programs. The execution of this code in the hardware makes our computer seem alive; that is to say it does things. That is its soul, so to speak.
God is triune just like us. He is a Father, a Son and a Holy Spirit. The son is the flesh or the body of physical matter, which walked among us. This body contained God's nature, i.e. Holy Spirit. And as a result of this interaction a door is open to the Being we pray to, the Father, the mind or thinking of God.
The Bible tells that Jesus was God. In John, chapter 1, verses 1-10 we are told, "… the word was God. … All things came into being by Him, and apart from Him nothing came into being … He came to bear witness of the light … He was in the world, and the world was made through Him, and the world did not know Him." That is to say, through the physical body of God (the son, the Angel of the LORD, Yahweh, the I AM, the Almighty, …) created the "big bang" by speaking the words of the mind of God (Father) using the power or nature of God (the Holy Spirit). We also in John 8:56-58 read "Your father Abraham rejoiced to see My day … Truly, truly, I say to you, before Abraham was born, I AM." The name I AM is the name God told Moses from the burning bush; it is the name Yahweh, the God of the Old Testament.
In the book of Ephesians, in chapter 4, verse 4 we are told God have only one body and one spirit. In verse 6 it is added there is only one God and Father. God is just a single being with three component parts, just as we have. However in Revelation 5:6 we read of the seven spirits of God. In the book of Zechariah it is the seven eyes of God, the symbol of eye as the spirit is repeated in the book of Ezekiel. In the book of Isaiah chapter 11, in verse 2 we are told what these spirits or eyes of God are, 1) spirit of the LORD, 2) spirit of wisdom, spirit of understanding, spirit of counsel, spirit of strength, spirit of knowledge, and spirit of the fear of the Lord. These are seven facets of the Holy Spirit. But the important part is that scripture likens them to eyes of God. It is the Holy Spirit that sees and knows all. It is the spirit of knowledge, spirit of understanding.
However in the book of Matthew 6:6-9 and Luke 11:2 we are told to address prayer to the Father, not the Holy Spirit. The Holy Spirit will dwell inside of the Christian and comfort the child of God, but prayer is to the Father.
Whenever we see God in the Old Testament we see the same God that we see in the New Testament, in the form of the Christ (also know as messiah). Now in our limited understanding the Divine nature of God we get a clue as to how God might know all, but also be able to answer prayers without taking away the free will of mankind. We pray to the Father, but it is the Holy Spirit, which knows all. The answer is that it is two different elements of God that cause our confusion on this issue.