Ezra 9:12

Now therefore give not your daughters unto their sons, neither take their daughters unto your sons, nor seek their peace or their wealth for ever: that ye may be strong, and eat the good of the land, and leave it for an inheritance to your children for ever.

God's command spoken through His prophets forbade Israel to give their daughters to the sons of the surrounding peoples, to take their daughters for their sons, or to seek their peace or wealth, so that Israel would stay separate from the heathen nations. That separation was a safeguard against apostasy, because mingling with the heathen nations largely led Israel into apostasy. That apostasy brought sad and humiliating experiences ending in the Babylonish captivity, when Israel with its kings and priests was delivered into the hand of the kings of the lands for sword, captivity, spoil, and shame, described as confusion of face.

Afterward God in goodness and mercy showed grace by leaving a remnant to escape, giving them a foothold in their native land, enlightened eyes, a reviving in bondage, and favor with the kings of Persia to set up His house, repair Jerusalem, and give a wall in Judah. That grace came after He punished them less than their iniquities deserved, lasted for a little space, included a nail in His holy place, and extended to repairing the desolations of His house and giving a wall in Jerusalem as well. To break this command again by joining with the people of these abominations would be ingratitude deserving consuming anger until no remnant nor escaping remained.