It was not an easy pregnancy. “The children struggled within her” (Gen. 25:22).
God now said to her – perhaps through a prophet, perhaps through Abraham who was still alive (Ibn Ezra) – “Two nations are in your womb, two peoples shall be separated from your bowels; one people shall be stronger than the other people, and the elder shall serve the younger” (verse 23).
Rabbinic commentary asserts that the widely differing destinies of the two children were evident even before their birth.
When Rebekah passed a bet midrash, Jacob struggled to get out of the womb; when she passed an idolatrous shrine, Esau wanted to get out. Their struggle presaged their later rivalry, each holding opposing views.
The point is made sharper by the words, “Two peoples shall be separated from your bowels”. This is probably not a reference to childbirth but means, “While they are still within you they will be different”.
An analogy is a verse about Samson in Judges 13:5, “The child shall be a Nazirite to God mi-beten, from the womb”.
Unless we read the passage this way there is no point in telling Samson’s mother not to take wine or strong drink while she is pregnant. Since Nazirites must not have wine or strong drink, the child in the womb must already be treated as a Nazirite.