There was a woman who used to pray behind the Messenger of Allah ﷺ, and she was strikingly beautiful, among the most beautiful of people. Some of the men would push forward to the first row so as not to see her, while others would hold back until they were in the last row, and then, when one of them bowed, he would look at her from beneath his armpit. So Allah revealed, "And We certainly know those among you who go forward, and We certainly know those who lag behind" [Hijr 15:24].
أخبرنا قتيبة قال حدثنا نوح يعني ابن قيس عن ابن مالك وهو عمرو عن أبي الجوزاء
كانت امرأة تصلي خلف رسول الله ﷺ حسناء من أحسن الناس قال فكان بعض القوم يتقدم في الصف الأول لئلا يراها ويستأخر بعضهم حتى يكون في الصف المؤخر فإذا ركع نظر من تحت إبطه فأنزل الله عز وجل {ولقد علمنا المستقدمين منكم ولقد علمنا المستأخرين}
[Its chain of transmission is daif] Tirmidhi narrated it in the chapter on tafsir of the Quran, section On Surah Hijr, hadith 3122, from Qutayba, with this wording, and it is also found in his Kubra, hadith 942. Amr bin Malik Nukri is daif, as I established in Tashil Hajah fi Takhrij Sunan Ibn Majah, hadith 1046.