Urwah (may Allah have mercy on him) narrated: (Before Islam, it was customary) that a man would divorce his wife, then before her waiting period (‘iddah) ended, he would take her back. Even if he divorced her a thousand times, the man would still return to his wife. Then a man divorced his wife and gave her respite, and when her waiting period was about to end, he would take her back and then divorce her again, and he would say: “By Allah, I will neither keep you nor set you free.” So Allah the Exalted revealed this verse: “Divorce is twice; then, either keep [her] in an acceptable manner or release [her] with good treatment.” (Al-Baqarah: 229) After the revelation of this verse, people began to pay attention to divorce anew, whether they had divorced or not.
Hadith Referenceمسند الإمام الشافعي / كتاب الرجعة / 1277
Hadith Takhrijاخرجه الترمذى الطلاق واللعان، باب نزول قوله ﴿الطلاق مرتان ...﴾ (1192) وقال ”صحیح“ والبيهقي: 7/ 444 - وفى المعرفة السنن والآثار له (4425) وصححه الحاكم: (2/ 279)۔