Here are the relevant passages:
|1 Samuel 23:2||1 Samuel 18:6|
|1 Samuel 23:4|
|1 Samuel 30:8|
|2 Samuel 2:1|
|2 Samuel 5:19|
|2 Samuel 5:23|
Note that every time David inquired of the Lord, David got an answer. Saul, on the other hand, did not.
Saul, though chosen by God to be king, nearly immediately after Israel was united behind him, disobeyed God. In 1 Samuel 13:8, Saul was to wait for Samuel to offer sacrifice. When Samuel was late, Saul, when he saw the people leaving him, offered the sacrifice himself.
Note Samuel’s response to this in 1 Samuel 13:14. The Lord is looking for one after his own heart. That is how David is described in Acts 13:22 with the words out of 1 Samuel 13:14.
Saul though chosen, never had the heart that David did. David though he struggled, came to the Lord for direction even when the circumstances seemed to be identical.