When persecution doesn’t work the strategy of the Devil is to bring about false teaching in the church. False teachers latch on to something true, and they lead from there to a plausible but deadly error.
That’s why Peter has to fight for the truth - as Paul also did in writing to the Galatian church. He told them that, in falling for the heresy of legalism, they were turning away so soon from Him who called you in the grace of Christ, to a different gospel, which is not another (Galatians 1:6-7).
Legalism has to do with the way in which we approach God; there are only two ways to do so: through the law or through the gospel. The first of these modes is legalism, and it is deadly:
Law: God is put into justice mode when we switch into performance mode
“Now, therefore, why are you putting God to the test by placing a yoke on the neck of the disciples that neither our fathers nor we have been able to bear?”
Gospel: God is put into grace and mercy mode when we switch into faith mode
“But we believe that we will be saved through the grace of the Lord Jesus, just as they will."