And not only so, but also when Rebekah had conceived children by one man, our forefather Isaac,  though they were not yet born and had done nothing either good or bad—in order that God's purpose of election might continue, not because of works but because of him who calls— (ESV)
Let's go back in history once again and try to discover what God intended to accomplish in bringing the promise of redemption to mankind through the nation of Israel. We have established that God called Abraham and promised that all nations of the earth would be blessed through him. He was promised a son, Isaac, who was given to him in his old age.
Isaac, the son of Abraham had two children. They were twins, Jacob and Esau. Which one would God choose to continue his promise through? God chose Jacob. We could assume that God knew what kind of man Jacob would become because as God he knows all things, and so he chose Jacob over Esau based on his knowledge of Jacob's future behavior. We would be wrong.
Paul says that God's choice was made before the children were born, but it had nothing to do with their future works. Paul spells that out very clearly in these verses. God's choice is demonstrated as a direct expression of his sovereign will. God's purpose of election continues, not because of works, past or present, but rather because of God.
We have our own ideas of what God should do. We need to submit our understanding to the authority of God's Word. Many Christians would like to think that God looked down through time and saw how wonderful we would be in choosing to follow Christ, and so he chose us based on knowing our future actions. That is not consistent with biblical election. God is sovereign. We are not.
Election is a tough doctrine. In these verses we find God electing Jacob over Esau. God chose, in accordance with his perfect will, not based on works of man. This is still the way he elects people unto salvation. He gets all the glory. Election is his work.