St. Thomas Aquinas
“The effect of this sacrament (Eucharist) is received according to man’s condition: such is the case with every active cause in that its effect is received in matter according to the condition of the matter. But such is the condition of man on earth that his free-will can be bent to good or evil. Hence, although this sacrament of itself has the power of preserving from sin, yet it does not take away from man the possibility of sinning.”
Source: St. Thomas Aquinas, Summa Theologica