Notice, too, the instructive tension presented in this passage between Paul seeing this affliction as a messenger from Satan while praying to the Lord to remove it. This helps enormously in understanding Paul’s mindset as he considered the nature of the suffering he currently underwent. In the midst of his suffering, Paul did not look to God merely to comfort him during this time of supposedly unwanted and purpose, affliction that had been brought to him exclusively from Satan. On the contrary, Paul prayed to God to remove the affliction, believing that God had full power and authority over this affliction and could remove it if he wished. So then, while this affliction came directly from Satan to harm Paul, indirectly and ultimately this affliction was permitted by the intentional agency and sovereign ordination of God, who could allow it to be given at all, could remove it when and if he wished, and would ordain that Paul experience it only if it served the good purposes that he (God), not Satan, designed it to bring.
Quoted from Ware, B. A. (2004). God’s greater glory: The exalted God of Scripture and the Christian faith . Wheaton, Ill: Crossway Books, p. 176.