This verse was revealed while the Messenger of Allah ﷺ was in hiding in Mecca, "And do not be loud in your prayer, nor silent in it" [Isra 17:110].He said, whenever the Prophet ﷺ led his companions in prayer, he would raise his voice with the Quran. When the polytheists heard this, they would insult the Quran, the One who revealed it, and the one who brought it.So Allah said to His Prophet, "And do not be loud in your prayer", meaning in your recitation, so that the polytheists hear it and insult the Quran, "nor silent in it" from your companions, so that they cannot hear the Quran in order to learn it from you, "but seek a way between that" [Isra 17:110].
حدثنا هشيم أنبأنا أبو بشر عن سعيد بن جبير
نزلت هذه الآية ورسول الله ﷺ متوار بمكة {ولا تجهر بصلاتك ولا تخافت بها} قال وكان النبي ﷺ إذا صلى بأصحابه رفع صوته بالقرآن فلما سمع ذلك المشركون سبوا القرآن وسبوا من أنزله ومن جاء به قال فقال الله عز وجل لنبيه {ولا تجهر بصلاتك} أي بقراءتك فيسمع المشركون فيسبوا القرآن {ولا تخافت بها} عن أصحابك فلا تسمعهم القرآن حتى يأخذوه عنك {وابتغ بين ذلك سبيلا}