Say, "Call upon Allah or call upon the Most Merciful. Whichever [name] you call - to Him belong the best names." And do not recite [too] loudly in your prayer or [too] quietly but seek between that an [intermediate] way.
[Qur'aan 17:110 - Translation Sahih International]
Narrated Ibn `Abbas:
(regarding): 'Neither say your, prayer aloud, nor say it in a low tone.' [Qur'aan 17:110] This Verse was revealed while Allah's Messenger (sallallaahu alayhi wa sallam) was hiding himself in Mecca. When he prayed with his companions, he used to raise his voice with the recitation of Qur'an, and if the pagans happened to hear him, they would abuse the Qur'an, the One who revealed it and the one who brought it. Therefore Allah said to His Prophet : 'Neither say your prayer aloud.' [Qur'aan 17:110] i.e. do not recite aloud lest the pagans should hear you, but follow a way between.
[Sahih al-Bukhaari Hadith No. 4722]
'A'isha reported that so far as these words of (Allah) Glorious and High are concerned:
"And utter not thy prayer loudly, not be low in it" [Qur'aan 17:110] relate to supplication (du'a').
[Sahih Muslim Hadith No. 447]
As you can see the scholars have differed in regards to the reason for the revelation of this Verse. al-Qurtubi mentions four additional sayings of scholars for the reason for the revelation of this Verse.
An interesting thing to note here is that Allaah used the word al-Salaah, which means prayer to refer, to the recitation of the Qur'aan. He used the term prayer to refer to a specific part of prayer [i.e. recitation which is a part of prayer].
Parts make up prayer. These parts include the Qur'aan, rukuu, and Sujuud.
It was the habit of the Arabs to use the name of an object to refer to its constituent parts. At other times, they used a constituent part to refer to the object.
For example, Allaah uses the specific term rukuu and Sujuud in the Qur'aan to refer to prayer. Rukuu and Sujuud are parts of prayer.