Then he clarifies his thesis, when he says for when the children were not yet born:
first, by the authority of Genesis (Gen 25:24);
second, by a text from the prophet Malachi, at as it is written.
In regard to the first he does three things: first, he indicates the time of the promise and says that when the children were not yet born, one of the sons of Rebecca was set over the other in virtue of the promise.
And just as his previous statement excluded the opinion of the Jews trusting in the merits of their forefathers, so this statement counters the error of the Manicheans who claimed that a ...person's life and death were controlled by the constellation under which he was born, against what is said in Jeremiah: be not afraid of the signs of heaven which the heathens fear (Jer 10:2).
Then when he continues: nor had done any good or evil, the Pelagian error is refuted which says that grace is given according to one's preceding merits, even though it says in Titus: he saved us, not because of deeds done by us in justice, but in virtue of his own mercy (Titus 3:5).
Both of these are shown false by the fact that before birth and before doing anything one of Rebecca's sons is preferred to the other.
This also corrects Origen's error who supposed that men's souls were created when the angels were, and that they merited different lives depending on the merits they earned for the good or evil they had done there. This could not be true in the light of what is stated here, namely that for when the children were not yet born, nor had done any good or evil. Against this also is Job: where were you when the morning stars praised me together and all the sons of God made joyful melody? (Job 38:7). For according to Origen's error, he could have answered: I was among those joyful sons of God.
Second, he shows what could be understood from that promise by which one of the twins in the womb was chosen over the other. He says: in order that God's purpose, by which one would be greater than the other, might stand, i.e., be made firm: and this not by reason of merits but according to election, i.e., inasmuch as God himself spontaneously forechose one over the other, not because he was holy but in order that he be holy, as it says in Ephesians: he chose us in himself before the foundation of the world that we should be holy (Eph 1:4). But this is a decree of predestination about which the same text says: predestined according to the purpose of his will (Eph 1:15).
Source: Commentary on Romans