Allāh knows with His eternal knowledge the count of all things.
The author may Allāh have mercy upon him said the verse
وأحصى كل شيء عددا
means that Allāh The Exalted knew with His eternal knowledge the count of all things. He knew that before He created any of the creations just as Allāh revealed in Surah Al-Jinn
وأحصى كل شيء عددا
The author may God have mercy upon him said God does whatever He wills. This means that He, The Exalted, does whatever He wills and so whatever He wills to occur with His eternal will then Allāh has made it exist with His eternal attribute of action. Allāh has no beginning and his attributes have no beginning. His will has no beginning and the willed things that occur have a beginning. His action is eternal and the creation has a beginning. Allāh’s attribute of creating has no beginning and as for the creation then it has a beginning.
Allāh’s will does not change because change occurs to the creation and change is the biggest evidence of creation.
Allāh revealed in Surah Qāf
ما يبدل القول لدي
Which means My will is not subject to change. The messenger of Allāh peace be upon him said that Allāh revealed O Muhammad, When I decree a matter, it will never be changed. Narrated by Muslim. In reality what changes is the creations according to God’s will which does is not subject to change. Therefore whatever Allāh willed to occur shall definitely exist at the time that Allāh willed for it to exist in. Whatever Allāh did not will to occur shall never occur, just as it is confirmed that the Prophet peace be upon him said: “Whatever Allāh willed to be shall be and whatever did not will to be shall never be.” Narrated by Abū Dawoud. God wills everything to occur whether it were good or evil, obedience or sin, and blasphemy or belief. All of those things occur by the will of Allāh and His knowledge. However, goodness is accepted by Allāh and He orders us to do it. Evil is not accepted by Allāh and he forbids us to do it.