And that end must be known to the Creator. For the final cause comes first in knowledge and will, but last in existence and realization. Thus, the Creator must know what He has created: He has willed it and willed the end for which He created it, and will necessarily entails knowledge. It is impossible for a living being to will something of which it has no awareness. When a craftsman intends to make something, he knows it and wills it, and has determined in his mind what he will make, the end it is to attain, and what will bring it to that end.
Allah, glorified be He, decreed and recorded the destinies of created beings before creating them, as is established in Sahīh Muslim, from ‘Abd Allāh ibn ‘Amr, that the Prophet, may Allah bless him and grant him peace, said:
“Allah decreed the destinies of created beings fifty thousand years before He created the heavens and the earth, and His Throne was upon the water.”
Al-Bukhārī also relates from ‘Imrān ibn Husayn that the Prophet, may Allah bless him and grant him peace, said:
“Allah was, and there was nothing before Him. His Throne was upon the water. He wrote everything in the Record and created the heavens and the earth.”
In another version: “Then He created the heavens and the earth.”