When David wrote these verses, many of the things he considered secure in his life were crumbling around him. He was pursued by an enemy and forced to flee from his home. He was separated from loved ones. He was separated from the temple and, therefore, from corporate worship of God. He faced desperate times of danger and uncertainty. He, who had bravely fought lions as a shepherd and defeated a giant as a young man, was now too familiar with fear as a companion.