"Legalism is the notion that a sinner can, by his own efforts, or by the power of the Holy Spirit in his life, do some work to obtain or retain his salvation. Some legalists think man has free will and can perform good works if he just sets his mind to it, thereby obtaining the favor of God. This type of legalist thinks that a sinner can believe the Gospel on his own steam. Other legalists think that a sinner does not have free will, that any good he does is done by the power of the Holy Spirit dwelling in him, and it is these good deeds done by the power of the Holy Spirit that obtain or help obtain, retain or help retain, his salvation.
Both types of legalists, but especially the latter, may acknowledge that Christ's work of obedience is necessary for salvation, but both deny that Christ's work is sufficient for salvation. Both types of legalists assert that to Christ's work must be added the works of the sinner, done either under his own steam, or by the power of the Holy Spirit. That is what makes them legalists: their shared belief in the incompleteness or insufficiency of the work of Christ outside of them. They may differ on what constitutes good works; they may differ on whether only God's law or church law as well is to be obeyed; but they agree that the work of Christ alone is insufficient for their final salvation."
-John W. Robbins