They appear to be thinking only in terms of hard legalism, which is the notion that either your works bribe God or that they are self-produced by your own effort. But, as you flesh it out, hard legalism does not exhaust the definition of legalism.
There is also soft legalism, which is the belief that your God-empowered obedience justifies you before God, or that you ‘become saved’ by faith but ‘remain saved’ by God-produced works (which includes the idea that final justification is based on obedience). In fact, Sanders acknowledged that the first century Jews believed that they got into the covenant by grace but ‘stayed in’ by works. But he failed to realize that this is legalism. The new perspective—and those taking their initial cues from it—typically conflate legalism and Pelagianism, seeming to think that because they (or the first century Jews) are not Pelagians, they therefore cannot be legalists. It needs to be made crystal-clear that these are distinct issues. You can utterly reject Pelagianism and yet be a legalist. You can be a Calvinist legalist, an Augustinian legalist, a believing-in-grace-empowered-works legalist. . . . This is perhaps the central issue of the debate and is probably a big part of the reason that they are going wrong. The essence of legalism is the belief that our right standing with God is based on, comes by means of, or is sustained by our works—regardless of whether those works are self-produced (hard legalism) or whether they are completely produced by God’s grace in us (soft legalism).
(Matt Perman, cited in John Piper, The Future of Justification (p. 152).
HT: Adrian Warnock