Bismillahi rahmani raheem, assalamu alaikum.
Allah says He created Adam (as) in His image, the scholars explain that is in reference to his spiritual side not his physically body which comprises of the sum of his intellect, heart and soul and what man does with them.
Because of this Scholars like Imam ibn Arabi said the act of creation is similar to man Imagining something, then expressing it, when Allah commanded Kun it occurred with His capacity and the intention behind the expression contained Allah’s knowledge of all things.
Before we were created everything existed only in Allah’s knowledge, so the Imams explained creation wanted to be created hence that was a force that exerted itself until Allah created.
But that is not why Allah created all things, the reason why Allah created all of us was to give us our worth, a thing that remains only in your knowledge can only exist in abstract form, as the sum of its ideas, but it’s worth can only exist and be known in its living or created form.
Allah wanted to create Rasul Allah (saws) to give Him His (saws) worth with Him, and that difference between existing in Allah’s knowledge and its reality after being created is also knowledge that is with Allah which could only be actualised after creation was created.
If Allah did not create Rasul Allah (saws) He could not receive His worth, why do i say worth and not qualities or attributes, because Your place with Allah is a result of your qualities and attributes, it is the end of things, of course what I am saying about Rasul Allah (saws) applies to all things.
So, the act of creation was an act of Love by Allah for His creations, His wish to spend the rest of eternity with us.
وَحَنَانًا مِّن لَّدُنَّا وَزَكَاةً
Shaykh Rami Al Rifai.