Why did David cry out to the Lord? What difficulties did he encounter?

The threat of the enemy. David was threatened by many enemies in his life. They want to hurt him or take his country. In this dilemma, David turned to God for strength, protection and salvation. In many poems in the Bible, King David expressed his feelings, perplexities and needs. He turned to God for help through poetry.