"O you who have believed, when the believing women come to you as emigrants, examine them." This pertains to the women of the polytheists with whom there is a treaty. Their examination, according to the interpretation of Qatada, was that they should be made to swear by Allah that they were not driven out by marital discord, and that nothing drove them out but love for Islam and eagerness for it.
"Allah is most knowing of their faith," whether they are truthful or lying. "And if you know them to be believers"—meaning, when they profess Islam and swear by Allah that they were not driven out by marital discord, and that nothing drove them out but love for Islam and eagerness for it—"then do not return them to the disbelievers; they are not lawful [for them], nor are they lawful for them. And give them what they have spent. And there is no blame upon you if you marry them when you have given them their compensation"—meaning their dowries—"and do not hold onto marriage bonds with disbelieving women"—meaning the disbelieving women of the Arabs, when they refuse to embrace Islam, that their way should be cleared—"and ask for what you have spent, and let them ask for what they have spent. That is the judgment of Allah; He judges between you." This is a judgment that Allah decreed between the people of guidance and the people of misguidance, in the interpretation of Qatada.
Qatada said: When they would flee to the companions of the Messenger of Allah, and their husbands were among those with whom there was a treaty, if they married them, they would send their dowries to their husbands among the polytheists. And when they would flee from the companions of the Messenger of Allah to the disbelievers with whom there was a treaty between them and the Messenger of Allah, if they married them, they would send their dowries to their husbands among the Muslims. This was [the practice] between the companions of the Messenger of Allah and the people of the treaty among the polytheists. Then this ruling and this treaty were abrogated in [Surat] Bara'ah, for the treaty was cast back to every possessor of a treaty, and its interpretation has already passed.