Hushaym reported from Abu Bishr, from Saeed bin Jubayr, that Ibn Abbas said concerning the verse "And do not be loud in your prayer", that it was revealed in Makkah. Whenever the Messenger of Allah ﷺ raised his voice in reciting the Quran, the polytheists would revile the Quran, the One who sent it down, and the one who brought it. So Allah revealed "And do not be loud in your prayer" [Isra 17:110], meaning do not recite loudly, or else they will revile the Quran, the One who sent it down, and the one who brought it. And "nor be too quiet in it" [Isra 17:110], that is, from your companions, but let them hear you so that they may learn the Quran from you.
حدثنا عبد بن حميد حدثنا سليمان بن داود عن شعبة عن أبي بشر عن سعيد بن جبير ولم يذكر
وهشيم عن أبي بشر عن سعيد بن جبير عن ابن عباس {ولا تجهر بصلاتك} قال نزلت بمكة كان رسول الله ﷺ إذا رفع صوته بالقرآن سبه المشركون ومن أنزله ومن جاء به فأنزل الله {ولا تجهر بصلاتك} فيسبوا القرآن ومن أنزله ومن جاء به {ولا تخافت بها} عن أصحابك بأن تسمعهم حتى يأخذوا عنك القرآن
Agreed upon by Bukhari and Muslim. Bukhari narrated it in the Book of tafsir, chapter titled "And do not recite your prayer aloud, nor speak it too quietly," no. 4722, and Muslim narrated it, no. 446, from the hadith of Hushaym, with the same wording.