Now its answer can be given in two ways: one in brief and the other in detail.
The brief answer is that when the purpose of this worship is to fulfill the needs of Allah and by obeying Him we give some benefit to Him, then the question arises that Allah is unlimited and away from all defects and needs; then what is the need for our worship, but the purpose of worshipping Him would be to elevate ourselves, then the worship would be a means to elevate ourselves and for goodness and it will a favor and guidance from Allah to make us reach perfection through worship.
The detailed answer is as follows: Worship, supplication and whatever deed is performed for pleasing Allah, more or less it has the effect on the person and society also. In fact these are the highest training and ethics in the school of Islam because:
a) The worship of Allah creates a sense of thankfulness, respect and honor. To realize the value of the source from where man gets the valuable divine blessings is a sign that the person was deserving of them.
b) The worship of Allah elevates the soul of man. What else can be more elevating that he gets connected to the total perfection and that is Allah, and for the duties of worship and the affairs of this life we ask help from the unending and unlimited power and acquire that much capability that we can communicate with Him.
These benefits are present in all the worship acts, which are performed correctly, and other worship acts like Prayers, Fasting and Hajj etc have their own benefits and effects. We shall discuss the secrets of the most important Islamic worship acts in brief, so that it becomes clear that worship and supplication benefit us and Allah is not in need of them.
THE IMPORTANCE OF PRAYER
The importance of the prayer in Islam cannot be understated. It is the first pillar of Islam that the Prophet, may the mercy and blessings of God be upon him, mentioned after mentioning the Testimony of Faith, by which one becomes a Muslim. It was made obligatory upon all the prophets and for all peoples. God has declared its obligatory status under majestic circumstances. For example, when God spoke directly to Moses, He said,
“And I have chosen you, so listen to that which is inspired to you. Verily, I am God! There is none worthy of worship but I, so worship Me and offer prayer perfectly for My remembrance.” (Quran 20:13-14)
Similarly, the prayers were made obligatory upon the Prophet Muhammad during his ascension to heaven. Furthermore, when God praises the believers, such as in the beginning of the chapter entitled ‘al-Muminoon’ (the Believers), one of the first descriptions He states is their adherence to the prayers.
Once a man asked the Prophet about the most virtuous deed. The Prophet stated that the most virtuous deed is the prayer. The man asked again and again and for the first three times, the Prophet answered, “The prayer,” then on the fourth occasion he stated, “Jihad in the way of God.”
credit: al-islam.org, islamreligion.com