This event happened after David was anointed by prophet Samuel to be the next King. King Saul became tormented and bitter and his advisors suggested to bring a musician to calm his spirits. The spin in the story is that, ironically, they summoned David to play the harp, since he was known as a great musician.