Understanding meaning of life
Question

how to understand ayah 56 from al-Dhariyat and ayah 72 from al-ahzab? because in that verse from alDhariyat mentions that Allah created humans to worship Allah, but in that verse from ahzab says that humans were not created to worship Allah, it is because AFTER humans have chosen to worship Allah, humans have responsibility to worship Allah.
Praise be to Allah.Firstly:
Allah the Exalted says (translation of the meaning): And I did not create the jinn and mankind except to worship Me. I do not want from them any provision, nor do I want them to feed Me. Indeed, it is Allah who is the [continual] Provider, the firm Possessor of strength (Adh-Dhariyat 51:56-58).
"Thus, He, Glorified be He, informed that He created the creation for His worship, and sent all the messengers commanding to worship Him Alone."
See: "Jawab Al-I`tiradat Al-Misriyyah `Ala Al-Fatwa Al-Hamawiyyah" (p. 90).
Imam Ibn Al-Qayyim (may Allah have mercy on him) said: "Without the divine command, the creation of man would have been in vain and futile, and Allah is exalted above that, and He has absolved Himself from it, just as He has absolved Himself from defects and deficiencies. Allah the Exalted says (translation of the meaning): Then did you think that We created you uselessly and that to Us you would not be returned? and He says (translation of the meaning): Does man think that he will be left neglected? Ash-Shafi`i said (concerning the ayah): 'That he is not commanded nor prohibited.'"
It is known that leaving man like animals, neglected and idle, is contrary to wisdom; for he was created for the purpose of his perfection, and his perfection is to be knowledgeable of his Lord, loving Him, and standing in His servitude. Allah the Exalted says (translation of the meaning): And I did not create the jinn and mankind except to worship Me, and He says (translation of the meaning): That you may know that Allah is over all things competent and that Allah has encompassed all things in knowledge, and He says (translation of the meaning): That is so you may know that Allah knows whatever is in the heavens and whatever is on the earth, and that Allah is Knowing of all things.
This knowledge and this servitude are the purpose of creation and the command, and they are the greatest perfection of man, and Allah the Exalted, out of His care and Mercy for him, has exposed him to this perfection and prepared for him its apparent and hidden causes, and enabled him to attain it.
The basis of the divine command is Islam, faith, and excellence, and they all go back to being grateful for all blessings, small and great, from Him, and to glorify and revere Him and to deal with Him in a manner befitting His Majesty. So His favors are mentioned, and He is thanked and not denied, and He is obeyed and not disobeyed, and He is remembered and not forgotten.
This, along with the divine command including the adornment of the servant with every beautiful character, and his performance of every good deed and correct speech, and his avoidance of every bad character, and abstaining from every ugly act and false statement. Thus, his command includes the noblest of morals, the beauties of actions, the truth of speech, and benevolence to creation, and perfecting himself with all kinds of perfections, and shunning their opposites, and purifying himself from them, while exposing him to the great and everlasting reward, and the companionship of his Lord in the abode of eternity.
So which of the two matters is more befitting of wisdom? This, or sending him neglected like horses, mules, and donkeys, eating, drinking, and mating like animals?!
And does His sacred perfection require that?!
{So high [above all] is Allah, the Sovereign, the Truth. There is no deity except Him, Lord of the noble throne. So high [above all] is Allah, the Sovereign, the Truth. There is no deity except Him, Lord of the noble throne" (Al-Mu'minun 23:116) concluded from "Shifa' Al-'Aleel fi Masail Al-Qada' wa Al-Qadar wa Al-Hikmah wa Al-Ta'leel" (2/334-335).
Secondly:
Allah the Exalted says (translation of the meaning): Indeed, we offered the Trust to the heavens and the earth and the mountains, and they declined to bear it and feared it; but man [undertook to] bear it. Indeed, he was unjust and ignorant. [It was] so that Allah may punish the hypocrite men and hypocrite women and the polytheist men and polytheist women and that Allah may accept repentance from the believing men and believing women. And ever is Allah Forgiving and Merciful (Al-Ahzab 33:72-73).
The Trust mentioned in the noble verse is the performance of obligations and acting in obedience to Allah, as reported from Ibn `Abbas who said: "The Trust: the obligations, Allah offered them to the heavens and the earth and the mountains, if they performed them, He would reward them, and if they neglected them, He would punish them. They disliked that and feared it without disobedience, but out of reverence for the religion of Allah lest they fail to uphold it, then He offered it to Adam who accepted it with all that it entailed."
Imam Ibn Kathir mentioned several opinions regarding the Trust, including:
1- That it is: obedience.
2- That it is: the religion, obligations, and limits.
3- That it is: the bath from sexual impurity.
4- That it is: the Trust is threefold: prayer, fasting, and the bath from sexual impurity.
Then he said: "And all these opinions do not contradict each other, rather they are consistent and return to the fact that it is the divine command, and acceptance of the commands and prohibitions with their condition, which is that if one fulfills them, he is rewarded, and if he neglects them, he is punished. So man accepted it despite his weakness, ignorance, and injustice, except for those whom Allah has guided, and with Allah is aid sought" End quote from "Tafsir Ibn Kathir" (6/488-489).
Thirdly:
There is no contradiction between the noble verses mentioned in the question, for in the verse of offering the Trust, it is stated that man accepted the Trust with all that it entails of honor and obligation, and this is a choice from him to bear these obligations, and in the first verse, Allah the Exalted clarified the purpose of creating all creation, which is: His worship, and this worship is achieved by man by choice, not compulsion. Allah the Exalted created them for worship, so among them are those who believe and those who disbelieve. So whoever believes has fulfilled the Trust he chose before, and whoever disbelieves has betrayed that Trust.
As Allah the Exalted says (translation of the meaning): And [mention] when your Lord took from the children of Adam - from their loins - their descendants and made them testify of themselves, [saying to them], 'Am I not your Lord?' They said, 'Yes, we have testified.' [This] - lest you should say on the day of Resurrection, 'Indeed, we were of this unaware.' Or [lest] you say, 'It was only that our fathers associated [others with Allah] before, and we were but descendants after them. Then would You destroy us for what the falsifiers have done?' And thus do We [explain in] detail the verses, and perhaps they will return (Al-A'raf 7:172-174).
"And Allah the Mighty and Majestic says (translation of the meaning): Does man think that he will be left neglected? Indeed, every privilege is met with responsibility and obligation, and the greater the blessings of the Creator, Glorified and Exalted be He, upon the creature, the obligations come with matters of servitude. Allah the Exalted says (translation of the meaning): Indeed, we offered the Trust to the heavens and the earth and the mountains, and they declined to bear it and feared it; but man [undertook to] bear it. Indeed, he was unjust and ignorant.
The Trust, as explained by many commentators, is the obligations of servitude to Allah the Exalted. Therefore, the dominion over the universe and the honor with capacities and abilities were met with the burden of the obligations of servitude and stewardship on earth, And I did not create the jinn and mankind except to worship Me. The more man realizes the attribute of servitude in himself to Allah the Exalted, the closer he is to fulfilling the requirements of the Trust and keeping the covenant and performing the role entrusted to him. The further he is from the attributes of servitude to Allah the Exalted, the more his negligence and reluctance in performing his role for which he was created," End quote from "Mabahith fi I`jaz Al-Quran," Dr. Mustafa Muslim (p. 13).
And Allah the Exalted knows what the servants will do, and He has written that, Glorified and Praised be He, and it is necessary to know that Allah the Exalted created all creation for His worship, but the difference between man and others is that Allah the Exalted has given man a choice and will, if he turns to faith, He will guide him, and if he turns away, he will bear the consequences of this aversion.
Regarding this, some scholars have said about the first verse, that its meaning is: "Except to submit and acknowledge servitude to Me, and this has occurred from all of them willingly and unwillingly," End quote.
And some of them said: "The verse is specific to those who obey Him from both groups who have performed worship, so the meaning is that whoever is found to have performed worship, then he is created for it, and whoever is not found to have performed it, then he is not created for it."
There are other opinions, and they are incorrect "and the mistake arises from interpreting the verb (to worship) as occurring, then from those who interpret worship: as the legislative worship, the worship of obedience and compliance, they made the verse specific to the believers; because they are the ones from whom the worship of obedience occurred, not others, or they made it general and considered the tawhid of the disbelievers during hardship as the worship that occurred from them, or considered their acknowledgment of Lordship as the worship that occurred from them, but it does not benefit them. And those who interpret worship as the general worship, the worship of compulsion and submission, made the verse general; because this general servitude occurs from the general public, and likewise, those who interpret worship as recognition.
And the correct view: is what we have presented that the intended worship is the legislative worship, the worship of obedience and compliance, and that the verb (to worship) is expressed as His will, not as its occurrence, and that what is described as being willed without occurrence is only meant as the will to be obligated to it, and the command for it only. So the intended meaning of His saying: And I did not create the jinn and mankind except to worship Me: is not the occurrence of worship; rather the command for it as a test. And Allah is the One Who grants success to the correct path, there is no partner to Him," End quote "Majallat Al-Buhuth Al-Islamiyyah" (91/377-378).
Please see: A study of the saying of Allah the Exalted: And I did not create the jinn and mankind except to worship Me, by the esteemed Dr. Muhammad bin Abdul Rahman Abu Saif Al-Juhani, Majallat Al-Buhuth Al-Islamiyyah: (91/327-378).
And Allah knows best.