The following is an adaption from The Good News We Almost Forgot by Kevin DeYoung.
We are not saved by [works] but by faith alone. In the medieval church, many Christians had a superstitious view of [certain works]. This is why the Reformers objected to the Latin phrase ex opere operato (“from the work having been worked”). The Catholic Church taught [works] worked objectively based on the dispensing of the sacraments themselves. To the extent that ex opere operato insists on the validity of [works] despite the moral unworthiness of the one standing of ex opere operato, many churchgoers expected [works] to impart grace by some kind of magic, irrespective of their faith. But the Bible is clear: We are not saved just by virtue of [works]; we must have faith. [Works] are means of grace only insofar as we receive by faith the gospel truths promised.
All the gifts we receive from Christ we receive through the Holy Spirit, including faith itself.