This is the situation in which the psalmist is placed. He is in a time of crisis; he has sought refuge in the Lord. But he had been warned, either by friends or by the inner voice of conscience, that escape would be the most appropriate course of action. Also, the advice carried within it a reminder of the might of wicked persons and of the threat contained within the crisis. There are times when such advice must be heeded, not out of fear, but out of prudence. But there are also times when it is necessary to take a stand, to refuse to admit to the natural and legitimate fear precipitated by the crisis, and to be confident in God who is still on the throne, still controlling the affairs of mankind. It was just such a situation that the psalmist encountered.
PETER C. CRAIGIE AND MARVIN TATE, PSALMS 1-50, VOLUME 19: SECOND EDITION (WORD BIBLICAL COMMENTARY), 134.