What does 1 Samuel 16:23 mean?
This describes the exact result Saul's servants had hoped for when suggesting a skilled musician to play for the king (1 Samuel 16:15–17). God rejected Saul as king due to rebellion (1 Samuel 13:11–14; 15:17–29). God also removed His Spirit from Saul and allowed a harmful spirit to torment the sitting king (1 Samuel 16:14). This spirit is not necessarily evil in the moral sense—the Hebrew word used here can also refer to sadness, adversity, or affliction.God chose David as Israel's next king; Samuel had anointed the young man (1 Samuel 16:1–13). David may not have known the exact reason for this anointing. Saul seems completely unaware of the entire encounter. But the reader can clearly see God at work. One of Saul's servants suggested David as the musician who could ease Saul's torment (1 Samuel 16:18). David quickly gained favor with Saul, thus giving the young man many opportunities to learn about being king (1 Samuel 16:19–22).
Here we learn that when David would play the lyre—a stringed, harp-like instrument—Saul would become refreshed in his spirit. Not only this, but also the harmful spirit would leave him for a time. Whether because the Spirit of God was on David or God told the evil spirit to leave, He surely allowed David's music to provide the relief Saul sought. That the spirit's influence was affected by Saul's mood indicates he was never "possessed," but being influenced.
Perhaps the harmful spirit left Saul briefly because of David's skillful playing and the content of David's songs of praise and worship to the Lord. In addition to everything else David accomplished, he became famous for godly music. He wrote and played songs (2 Samuel 1:17–19; 1 Chronicles 16:8; Psalm 105:1), including many of the Psalms. He invented instruments (Amos 6:5). David established the temple musicians who were "in charge of the service of song in the house of the Lord" (1 Chronicles 6:31).