Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:60:11

And if you have lost any of your wives to the disbelievers and you subsequently obtain ˹something˺, then give those whose wives have gone the equivalent of what they had spent. And fear Allah, in whom you are believers.  

And if you lose any of your wives, that is to say, ˹if you lose˺ one or more of them — or ˹it means if you lose˺ anything of their dowries — by ˹their˺ going, to the disbelievers, as apostates, and so you retaliate, you embark upon a raid and capture spoils ˹from them˺, then give those whose wives have gone, from the spoils, the like of what they have expended, for their having lost it to the disbelievers. And fear God in Whom you believe. And indeed the believers did what they had been commanded to do in the way of paying ˹back˺ the disbelievers ˹the dowries of their former wives˺ and the believers ˹the dowries of the women who had apostatised˺. Afterwards, however, this stipulation was annulled.
القرآن:٦٠:١١

وَإِنْ فَاتَكُمْ شَيْءٌ مِنْ أَزْوَاجِكُمْ إِلَى الْكُفَّارِ فَعَاقَبْتُمْ فَآتُوا الَّذِينَ ذَهَبَتْ أَزْوَاجُهُمْ مِثْلَ مَا أَنْفَقُوا ۚ وَاتَّقُوا اللَّهَ الَّذِي أَنْتُمْ بِهِ مُؤْمِنُونَ  

{وإن فاتكم شيء من أزواجكم} أي واحدة فأكثر منهن أو شيء من مهور بالذهاب {إلى الكفار} مرتدات {فعاقبتم} فغزوتم وغنمتم {فآتوا الذين ذهبت أزواجهم} من الغنيمة {مثل ما أنفقوا} لفواته عليهم من جهة الكفار {واتقوا الله الذي أنتم به مؤمنون} وقد فعل المؤمنون ما أمروا به من الإيتاء للكفار والمؤمنين ثم ارتفع هذا الحكم.