Saeed bin Jubayr reported,

Ibn Abbas رضي الله عنهم said, regarding the words of Allah the Exalted "And do not be loud in your prayer, nor be silent in it" [Isra 17:110], that it was revealed while the Messenger of Allah ﷺ was in hiding in Makkah. When he prayed with his companions he would raise his voice with the Quran, and when the polytheists heard it they would insult the Quran, and the One who sent it down, and the one who brought it.So Allah said to His Prophet ﷺ, "And do not be loud in your prayer" [Isra 17:110], meaning in your recitation, so that the polytheists hear it and insult the Quran, "nor be silent in it" [Isra 17:110], keeping it from your companions so that they cannot hear you, "but seek a way between that" [Isra 17:110].

Bukhari 7525

Sahih

حدثني عمرو بن زرارة عن هشيم أخبرنا أبو بشر

عن سعيد بن جبير

عن ابن عباس رضي الله عنهما في قوله تعالى {ولا تجهر بصلاتك ولا تخافت بها} قال نزلت ورسول الله ﷺ مختف بمكة فكان إذا صلى بأصحابه رفع صوته بالقرآن فإذا سمعه المشركون سبوا القرآن ومن أنزله ومن جاء به فقال الله لنبيه ﷺ {ولا تجهر بصلاتك} أي بقراءتك فيسمع المشركون فيسبوا القرآن {ولا تخافت بها} عن أصحابك فلا تسمعهم {وابتغ بين ذلك سبيلا}

البخاري 7525صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tawhid
Chapter
Allah's saying, "And conceal your speech or make it public, He is Aleem of that which is in the breasts. Does He who created not know, while He is the Subtle, the Acquainted?"
Numbering
Darussalam 7525
Bukhari 7525