|Immaculada Concepcion, Zubaran|
In 1854, Pope Pius IX issued the Apostolic Constitution Ineffabilis Deus in which definitively pronounced that the Blessed Virgin Mary "in the first instance of her conception, by a singular privilege and grace granted by God, in view of the merits of Jesus Christ, the Saviour of the human race, was preserved exempt from all stain of original sin."
Theologians had wrestled with this teaching for years. Even St. Thomas Aquinas, the greatest theologian to ever live, couldn't reconcile the teaching with that of Original Sin. Then in the 13th Century, Blessed John Duns Scotus found the answer in the reality of God's omnipotence. He asserted that God sanctified Mary from the beginning of her creation because He could see that she would consent to His will and therefore she was bestowed the merits of the Cross before her creation. In other words God could sanctify her before her birth so He did.
The following analysis of the doctrine is taken from the Catholic Encyclopedia (I recommend you read their entire article on this subject):
"The Blessed Virgin Mary..."
The subject of this immunity from original sin is the person of Mary at the moment of the creation of her soul and its infusion into her body.
"...in the first instance of her conception..."
The term conception does not mean the active or generative conception by her parents. Her body was formed in the womb of the mother, and the father had the usual share in its formation. The question does not concern the immaculateness of the generative activity of her parents. Neither does it concern the passive conception absolutely and simply (conceptio seminis carnis, inchoata), which, according to the order of nature, precedes the infusion of the rational soul. The person is truly conceived when the soul is created and infused into the body. Mary was preserved exempt from all stain of original sin at the first moment of her animation, and sanctifying grace was given to her before sin could have taken effect in her soul.
"...was preserved exempt from all stain of original sin..."
The formal active essence of original sin was not removed from her soul, as it is removed from others by baptism; it was excluded, it never was in her soul. Simultaneously with the exclusion of sin. The state of original sanctity, innocence, and justice, as opposed to original sin, was conferred upon her, by which gift every stain and fault, all depraved emotions, passions, and debilities, essentially pertaining to original sin, were excluded. But she was not made exempt from the temporal penalties of Adam — from sorrow, bodily infirmities, and death.
"...by a singular privilege and grace granted by God, in view of the merits of Jesus Christ, the Saviour of the human race."
The immunity from original sin was given to Mary by a singular exemption from a universal law through the same merits of Christ, by which other men are cleansed from sin by baptism. Mary needed the redeeming Saviour to obtain this exemption, and to be delivered from the universal necessity and debt (debitum) of being subject to original sin. The person of Mary, in consequence of her origin from Adam, should have been subject to sin, but, being the new Eve who was to be the mother of the new Adam, she was, by the eternal counsel of God and by the merits of Christ, withdrawn from the general law of original sin. Her redemption was the very masterpiece of Christ's redeeming wisdom. He is a greater redeemer who pays the debt that it may not be incurred than he who pays after it has fallen on the debtor.