"And the dragon stood before the woman who was about to bear a child, that he might devour her child when she brought it forth." Yet in spite of this, "she brought forth a male child, one who is to rule all the nations with a rod of iron." Eve fell to the Devil, but Mary stood up against him, and brought to this wounded world the One to save us all!
That is why St. Irenaeus wrote the following words about Mary, in his 2nd century book “Against Heresies,” which was the first systematic defense of Christianity: "the original deception was to be done away with -- the deception by which that virgin Eve (who was already espoused to a man) was unhappily misled. …[T]his was to be overturned…[by] the Virgin Mary (who was also [espoused] to a man). … So if Eve disobeyed God, yet Mary was persuaded to be obedient to God. In this way, the Virgin Mary might become the advocate of the virgin Eve. And thus, as the human race fell into bondage to death by means of a virgin, so it is rescued by a virgin." (Against Heresies 5:19:1)
Such imagery is the root of the Catholic Church’s doctrine that Mary was divinely protected from all sin, including from the "original deception" -- the original sin -- into which the devil tempted Eve. Because, if Mary according to Scripture was supposed to replace Eve in facing the devil, and had to stand firm and oppose him where Eve fell to his temptation -- if Mary was so important in God’s plan of salvation that by her faith in the face of an unspeakable enemy, the Son of God was brought to our world -- then how shall it be that this opponent and enemy of the devil was to face him so squarely, if she was already under his influence? That’s why the Catholic Church teaches that she was not -- she was protected so that she could play that role in restoring humanity, in facing the devil unbiased as Eve did, but to say "No" to him this time, instead of "yes." And that is how Scripture implies Mary's sinlessness in the way it compares her to Eve.