From Pope Pius XII’s encyclical Mystici Corporis Christi (1943):
Now we see that the human body is given the proper means to provide for its own life, health and growth, and for that of all its members. Similarly, the Savior of mankind out of His infinite goodness has provided in a wonderful way for His Mystical Body, endowing it with the Sacraments, so that, as though by an uninterrupted series of graces, its members should be sustained from birth to death, and that generous provision might be made for the social needs of the Church. Through the waters of Baptism those who are born into this world dead in sin are not only born again and made members of the Church, but being stamped with a spiritual seal they become able and fit to receive the other Sacraments. By the chrism of Confirmation, the faithful are given added strength to protect and defend the Church, their Mother, and the faith she has given them. In the Sacrament of Penance a saving medicine is offered for the members of the Church who have fallen into sin, not only to provide for their own health, but to remove from other members of the Mystical Body all danger of contagion, or rather to afford them an incentive to virtue, and the example of a virtuous act.
Nor is that all; for in the Holy Eucharist the faithful are nourished and strengthened at the same banquet and by a divine, ineffable bond are united with each other and with the Divine Head of the whole Body. Finally, like a devoted mother, the Church is at the bedside of those who are sick unto death; and if it be not always God’s will that by the holy anointing she restore health to the mortal body, nevertheless she administers spiritual medicine to the wounded soul and sends new citizens to heaven—to be her new advocates—who will enjoy forever the happiness of God.
— Mystici Corporis Christi 18-19