“Many are the afflictions of the righteous, but the Lord delivers him out of them all. He keeps all his bones; not one of them is broken. Affliction will slay the wicked, and those who hate the righteous will be condemned.” -Psalm 34:19–21
Taking the second part, David recalls that one’s lifetime is filled with troubles. King Jobab (Genesis 10:29) agreed: “but man is born to trouble as the sparks fly upward” (Job 5:7). But the Lord had delivered him out of all his afflictions, as he was still alive to write about it. The wicked, on the other hand, will be slain by his afflictions.
The expression in verse 20, “He keeps all his bones; not one of them is broken” is a metaphor for the thoroughness of the Lord’s protection—safe to the core of his being.
This seems also to be an allusion to Christ, Jesus, our Savior, who suffered many afflictions at the hands of the wicked, people who hated the one who was the only truly righteous man. We are told that for all Jesus suffered on the cross, and though his bones were jarred out of joint and exposed, not a single one was broken (John 19:36 cf. Exodus 12:46 and Numbers 9:12).