Ruh (soul, spirit) is lexically defined as the source of life by which animals have sensation and voluntary movement. However, the term ruh has appeared in many verses in the Qur'an and it does not always mean the soul or spirit that is the source of life. God has described the spirit in different ways throughout His Book:
(1) As a separate entity like in the verse: The day on which the spirit and the angels shall stand in rank (78:38).
(2) The spirit sometimes accompanies the angels like the verse: The Faithful Spirit has descended with it to your heart by God's command (2:97).
(3) There is also the spirit that is blown into mankind in general as God says: Then He made him complete and breathed into him of His spirit (32:9).
(4) There is the spirit which accompanies the believers as deduced from the verse: And whom He has strengthened with an inspiration from Him (58:22).
(5) The spirit that God descended upon the prophets as seen in His words: He sends down the angels with the spirit by His commandment on whom He pleases of His servants.. (16:2).
(6) Some verses allude to the spirit in non-human beings like animals and plants because life is apparently as a result of having a spirit.
God has further clarified the reality of the spirit by saying: Say: The spirit is of the command of my Lord (17:85). In other words, the spirit is of the type and nature of divine command.
Then God has defined His command where He says: His command, when He intends anything, is only to say to it: Be, so it is. Therefore glory be to Him in Whose hand is the kingdom of all things (36:82-83).
There are two aspects to our existence: (1) A non-gradual aspect that is beyond the domain of time and space. (2) A gradual aspect through physical means operating in time and space. The first aspect is called "Amr" or command and the second aspect is called "khalq" or creation. However, khalq (creation) and amr (command) are two considerations of the same essential meaning of bringing something to existence.
Based on the above, God's command is His word which brings something into existence without the involvement of any physical means and their gradual effects - an act which belongs to Him exclusively. The spirit (ruh) has the same nature of existence as this command which belongs to the kingdom of all existent things.
Therefore, the question in the verse, And they ask you about the spirit. Say: The spirit is of the command of my Lord (17:85) pertains to the nature and reality of the spirit and the answer given explains that reality as something that is of the nature of God's command.
Reference: Al-Mizan, English Volume 25, pp. 266-271, first edition, Tawheed Institute Australia Ltd., 2015.