Hazrat Shaikh Moulana Muhammad Zakariyya (rahmatullahi ‘alaih) once mentioned the following:
The purpose for Allah Ta‘ala creating man in this world is so that he acquires the recognition of Allah Ta‘ala, and the purpose of all other creations is so that they may serve man. As a Persian poet says:
ابر وباد ومہ وخورشيد وفلک درکارند تا تو نانے بکف آري وبغفلت نخوري
ہمہ از بہر تو سرگشتہ وفرماں بردار شرط انصاف نہ باشد کہ تو فرماں نبري
The clouds, the winds, the moon, the sun and the sky, all are constantly at work, so that you earn your living and do not eat in forgetfulness.
The whole creation is involved in working for you and in your obedience. The law of justice will not be fulfilled by you if you fail to obey (Allah Ta‘ala).
In essence, the clouds, the winds, the moon, the sun, the sky and the earth – every creation is engaged in work for your sake so that you may fulfil all your needs through them. Man should ponder and reflect over how obedient and punctual these different creations are in serving him and fulfilling his needs.
Sometimes, Allah Ta‘ala causes temporary changes in the functions of these creations as a warning for man. Hence, the rains and winds are withheld and similar changes are witnessed in the moon and the sun through their eclipses. In essence, everything is subject to some change for admonishing those who neglect their duty to their Creator.
How astonishing indeed that all these things be made subservient to fulfil man’s needs, yet their obedience does not lead man to realizing that he should be obedient to his Creator.
(Fazaail-e-Aa’maal – Fazaai’l-e-Quraan (English pg. 92) (Urdu pg. 57)