The little word if
captures the thought that Peter’s readers might be suffering, but also might not be. Suffering for doing good is not necessarily inevitable for every Christian all the time. Further, with the phrase in question Peter would have his readers learn that suffering, if it happens, would never occur outside of God’s sovereign will. With his quote from Isaiah, Peter had earlier replaced the divine name Lord of hosts
with Christ the Lord.
This God—yes, the Christ who suffered for sinners (1 Peter 2:21)—is sovereign to the extent that no suffering escapes his control.
17 For it is better to suffer for doing good, if that should be God’s will, than for doing evil.