The Prophet of Allah ﷺ sent an army to Awtas. They met the enemy, fought them, and prevailed over them, capturing women whose husbands were among the polytheists. The Muslims felt uneasy about being intimate with them, so Allah revealed, "And married women, except those your right hands possess" [Nisa 4:24], meaning these are lawful for you once their waiting period has ended.
أخبرنا محمد بن عبد الأعلى قال حدثنا يزيد بن زريع قال حدثنا سعيد عن قتادة عن أبي الخليل عن أبي علقمة الهاشمي
أن نبي الله ﷺ بعث جيشا إلى أوطاس فلقوا عدوا فقاتلوهم وظهروا عليهم فأصابوا لهم سبايا لهن أزواج في المشركين فكان المسلمون تحرجوا من غشيانهن فأنزل الله عز وجل {والمحصنات من النساء إلا ما ملكت أيمانكم} أي هذا لكم حلال إذا انقضت عدتهن
Muslim narrated it in the Book of Suckling, Chapter on the Permissibility of Having Intercourse with a Captive Woman After Waiting for Her to Complete Her Waiting Period etc, hadith 1456, from the hadith of Yazid bin Zuray with this wording, and it is in Al-Kubra, hadith 5492. Saeed here is Ibn Abu Aruba, and Shuba corroborated him according to Muslim.