228. What is the relationship between the sacraments and faith?The sacraments not only presuppose faith but with words and ritual elements they nourish, strengthen, and express it. By celebrating the sacraments, the Church professes the faith that comes from the apostles. This explains the origin of the ancient saying "Lex ordandi, lex credendi," that is, the Church believes as she prays.
Further reading: CCC 1122-1126, 1133229. Why are the sacraments efficacious?
The sacraments are efficacious
ex opere operato ("by the very fact that the sacramental action is performed") because it is Christ who acts in the sacraments and communicates the grace they signify. The efficacy of the sacraments does not depend upon the personal holiness of the minister. However, the fruits of the sacraments do depend on the dispositions of the one who receives them.
Further reading: CCC 1127-1128, 1131