Impeccability is by God's grace in the Virgin Mother of God. HOWEVER implicit in that statement is the understanding that she cooperated with that grace. Her sinlessness was by her own freely willed choice, and by her faith.
From the CCC:
The Immaculate Conception
490 To become the mother of the Savior, Mary "was enriched by God with gifts appropriate to such a role."132 The angel Gabriel at the moment of the annunciation salutes her as "full of grace".133 In fact, in order for Mary to be able to give the free assent of her faith to the announcement of her vocation, it was necessary that she be wholly borne by God's grace.
491 Through the centuries the Church has become ever more aware that Mary, "full of grace" through God,134 was redeemed from the moment of her conception. That is what the dogma of the Immaculate Conception confesses, as Pope Pius IX proclaimed in 1854:
The most Blessed Virgin Mary was, from the first moment of her conception, by a singular grace and privilege of almighty God and by virtue of the merits of Jesus Christ, Savior of the human race, preserved immune from all stain of original sin.135
492 The "splendor of an entirely unique holiness" by which Mary is "enriched from the first instant of her conception" comes wholly from Christ: she is "redeemed, in a more exalted fashion, by reason of the merits of her Son".136 The Father blessed Mary more than any other created person "in Christ with every spiritual blessing in the heavenly places" and chose her "in Christ before the foundation of the world, to be holy and blameless before him in love".137
493 The Fathers of the Eastern tradition call the Mother of God "the All-Holy" (Panagia), and celebrate her as "free from any stain of sin, as though fashioned by the Holy Spirit and formed as a new creature".138 By the grace of God Mary remained free of every personal sin her whole life long.
"Let it be done to me according to your word. . ."
494 At the announcement that she would give birth to "the Son of the Most High" without knowing man, by the power of the Holy Spirit, Mary responded with the obedience of faith, certain that "with God nothing will be impossible": "Behold, I am the handmaid of the Lord; let it be [done] to me according to your word."139 Thus, giving her consent to God's word, Mary becomes the mother of Jesus. Espousing the divine will for salvation wholeheartedly, without a single sin to restrain her, she gave herself entirely to the person and to the work of her Son; she did so in order to serve the mystery of redemption with him and dependent on him, by God's grace:140
As St. Irenaeus says, "Being obedient she became the cause of salvation for herself and for the whole human race."141 Hence not a few of the early Fathers gladly assert. . .: "The knot of Eve's disobedience was untied by Mary's obedience: what the virgin Eve bound through her disbelief, Mary loosened by her faith."142 Comparing her with Eve, they call Mary "the Mother of the living" and frequently claim: "Death through Eve, life through Mary."143