(Rev 12:1-2 NIV) v.1 A great and wondrous sign appeared in heaven: a woman clothed with the sun, with the moon under her feet and a crown of twelve stars on her head. v.2 She was pregnant and cried out in pain as she was about to give birth.
Compare this description with Joseph’s dream.
(Gen 37:9 NIV) Then he had another dream, and he told it to his brothers. “Listen,” he said, “I had another dream, and this time the sun and moon and eleven stars were bowing down to me.”
The woman represents the Old Testament people of God who are to bring forth the Messiah. The Messiah is descended from Israel.
The Dragon (Satan) then tries to destroy the promised seed, various events are recorded in the OT in which there are attempts to destroy the line from which the Christ will be born.
Cain slays Abel, but Seth is raised, Gen 4.
Pharaoh orders the Israelite male babies to be killed, Ex 1:15.
Saul tries to kill David, 1 Sam 18:11.
When Athaliah proceeded to destroy the whole royal family, 2 Ki 11:1.
Haman tries to kill all the Jews but Esther intervenes, Esther 3:6, Esther 7:3
Herod tries to kill all the young male children
There are also various other points in the OT where the line leading to the Messiah could be broken.
When God destroys the people of the earth but saves Noah.
Sarah is unable to conceive, but the miracle child Isaac is born.
The lord orders Isaac to be sacrificed but then provides a substitute
Rebekah, Isaac’s wife was barren, but she conceives
Esau threatens to kill Jacob for robbing him of his birthright, but in the end does not.
The Lord wants to kill the children of Israel but Moses intervenes as an intercessor.