That teaching is known as the dogma of the Immaculate Conception of Mary. It means that she was conceived without original sin and had no inclination to sin as a result of original sin, she had freewill, but was as we will be (hopefully) in Heaven, following our intellect and not our passions.
The Immaculate Conception
490 To become the mother of the Savior, Mary "was enriched by God with gifts appropriate to such a role." 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.
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". 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".
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". By the grace of God Mary remained free of every personal sin her whole life long.
CCC - 490-493
If she were sinless, then it would be because God made her so, i.e. He saved her before or at the moment of her conception.
The other part, about her not dying, or at least not dying as we know it is the Catholic dogma of the Assumption of Mary. That dogma was never codified until the 1950's but is a very old tradition; older even than the apocryphal manuscript that corroborates it. The reason for her assumption is that she wouldn't feel the effects of sin (age, illness and death - or pain during childbirth). But, as a good Christian, the first Christian, she is thought to have desired to follow her Son in death. So, at the end of her earthly life, she was assumed into heaven and all this was done according to the will of God, because it was done in accord with the will of God and not against it.
There is disagreement, or at least a need for clarification, about what Mary's role is in our salvation. A lot of Catholics (me included) would like a definition of Mary as the Mediatrix of All Graces, but that hasn't happened yet. So, that part of your question is more or less up in the air as far as concrete Catholic teaching is concerned.
Needless to say (but I'll say it anyway) in just a few minutes of thinking about a question I doubt you ever considered before, you uncovered 2000 years of mariology (a separate branch of dogmatic theology from soteriology) and the rationale for the two dogmas and the one potential dogma - good job!