People regard David as the ideal king. Thus they easily forget the tumult he faced in securing the throne, uniting the tribes, and subduing the surrounding forces. Many of his prayers recorded in the Bible deal with his enemies (internal and external).
Lifeway’s Biblical Illustrator magazine asked me to write an article about all the enemies David had to deal with–enemies he often prayed against in the Psalms. You can find it here:
(Click the little box with an arrow and you’ll get a large enough image to read the print)