Peace is not the absence of affliction but the presence of God.
PSALM 34:19 Many are the afflictions of the righteous, but the LORD delivers him out of them all.
We are only righteous because of the blood of the Lamb.
MATTHEW HENRY'S COMMENTARY The righteous are taken under the special protection of the Lord, yet they have their share of crosses in this world, and there are those that hate them. Both from the mercy of Heaven, and the malice of hell, the afflictions of the righteous must be many. But whatever troubles befal them, shall not hurt their souls, for God keeps them from sinning in troubles. No man is desolate, but he whom God has forsaken.
PULPIT COMMENTARY When they have done their appointed work of purging, purifying, instructing, improving, or whatever else their work may be, God removes the afflictions with which he has visited us or allowed us to be visited, ultimately, when he takes us to himself, mercifully delivering us "out of them all."