In 1 Samuel 23, David is on the run, but at the same time, one of the cities to the south is being attacked by Philistines. Instead of worrying about running from Saul or how to organize his men so that he can become king, he rushes to the rescue of the city of Keilah from the Philistine attackers.
Once he rescues the city and defeats the Philistines, he finds out that Saul is coming to get him. Not only that, but the city he is in is a locked up, walled city, and once Saul gets there, David will be trapped. To make matters worse, God reveals to David that when Saul comes, the people of the city that he just rescued will hand him over to Saul and not protect him.
What opportunity for bitterness, revenge, hatred! “I just rescued you and now you are going to turn me over to Saul!?” It wouldn’t have even been out of context w/ the story if David slaughtered them all or stayed and fought against Saul using the walled city as his own fortress.
But that’s not what he did. He came to save that city, not to abuse their resources. He was focused and determined to do what God was calling him to do, not move his own progress forward.
THAT is what made David into a king, not that he sought the kingdom for himself, but that he sought the kingdom of God for God.