Most likely Saul gave David a high rank in his army only after he returned to Gibeah and threw his spear at him. This was done before, or as he sent David away on various campaigns against the Philistines (1 Samuel 18:12–19). The appointment of David as a commander of an army unit (1 Samuel 18:13) was met with universal approval from his advisors and the people as a whole. It was seen by them as a reward for David’s victory over Goliath.
5 And David went out and was successful wherever Saul sent him, so that Saul set him over the men of war. And this was good in the sight of all the people and also in the sight of Saul’s servants.