Excellent question.
Previously in the chapter, Paul tells of great revelations that God gave to him (graced to him; grace is a gift). From these visions and revelations, Paul was essentially ushered into the presence of God to see unspeakable glories.
Now, to keep him from proud feelings about his special honor, Paul was gifted again (graced to him) with some sort of tormenting affliction to keep his feet on the ground and his head in the right place. You can't feel super-special, like you have God on your hotline, if you have some severe problem that God doesn't answer your prayers about.
God's response: You received a revelation of God that most (if any) other humans don't get to see. That's good enough to carry you through any affliction. When you've seen glory, you can endure the afflictions of the flesh with a whole different mind.
My power is perfected in weakness.
Spiritual oppression puts us in a state of weakness, but it’s in that state that I can learn best about submission, servanthood, humility, and dependence. God is strong when I am submissive, humble, teachable, and dependent.
When I am feeling weak, I have several choices: (1) try to be stronger; (2) do everything to fix my own situation; (3) get somebody to help me. The third one is what the verses are talking about. Spiritual oppression and circumstantial garbage are upsetting, and can make us angry and bitter. I can try to fix the situation, which can be a good choice, but some situations aren't fixable. I can try to be stronger, which can be a good thing, but sometimes my strength isn't enough, and the fact that the situation might not be fixable keeps clubbing me from behind, and I just can't handle it any more. In that case the best choice is number 3: get somebody to help. When I choose this, I am also choosing submission, humility, and dependence. Those responses are all ones that allow God to work. If we pray with humility and dependence that God would fill us with Himself, because we’re feeling quite empty and inadequate, and just work on the relationship with Him, the grit of the unresolved circumstance will come under the strength of that prayer.