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 the Exalted 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 4722

Sahih

حدثنا يعقوب بن إبراهيم حدثنا هشيم حدثنا أبو بشر

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

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

البخاري 4722صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tafsir
Chapter
Neither pray aloud nor in a whisper
Numbering
Darussalam 4722
Bukhari 4722