Overall meaning :
Believers, when believing women leave their unbelieving husbands and come to you as migrants, submit them to a test. Allah knows best about their faith. Then if you have ascertained that they are true believers, do not return them to the unbelievers; for the believing women are not lawful wives for the unbelieving men, nor are the unbelieving men lawful husbands for the believing women. Nevertheless, repay their unbelieving husbands whatever dowries they have paid them. You will incur no sin whatsoever if you, believing men, marry the believing women who come to you as migrants after giving them their dowries.
Do not maintain your marriages, believers, with idolatrous, unbelieving women. Demand repayment of whatever dowries you have paid the unbelieving wives you divorce, and let the idolaters demand repayment of whatever dowries they have paid to the women who have embraced Islam and come to you as migrants. This is the judgement of Allah whereby He judges between you and the unbelievers. Allah is All-Knowing, All-Wise.
Should any of your wives, believers, desert you and go over to the unbelievers without repaying you the dowries you have given them, and you subsequently gain victory over them, then pay the believers whose wives have deserted them the equivalent of the dowries they have given them from whatever spoils you take from them; and fear Allah, in whom you believe.