1 Samuel 18:2

And Saul took him that day, and would let him go no more home to his father’s house.

Saul's taking of David followed the time when David's music soothed the king's troubled mind, and David's skill, faithful conduct, and the Lord's guidance won him Saul's favor. Saul then kept him with himself instead of letting him go back to his father's house, bringing him into service as attendant and armor-bearer. This placing was God's providence connecting David with the king.

There David's wise conduct won the confidence of the people, while hardship trained him to trust in God and prepared him to rule Israel. The bond formed there between Jonathan and David was part of God's provision to preserve David's life when Saul later tried to kill him. Later, when war with the Philistines resumed, David was allowed to return to his father's house and to shepherding.