In 1st Samuel 16:13 Samuel anointed David with oil. There is no indication that he said anything upon doing that. Did anyone but Samuel even know it was a Kingly anointing? Why didn't Samuel give David instructions on being king as he did for Saul?
A good question that has vexed numerous theologians for a long time. The problem exists because Saul and Abner did not recognise David, despite having already hired him as a court musician in 1 Sam 16:14-33, BEFORE(?) the incident with the giant in 1 Sam 17.
However, it is clear that not all the facts have been recorded and it is also clear that the narrative is not necessarily in chronological order. However, even if the incidents are recorded in chronological order, the King may not have known much about David and his family due to his mental illness and the fact that David was only called during the bouts of illness. The state of Saul's mind could also mean that his growing narcissistic paranoia helped preclude much awareness of others, further emphasising the king's parlous mental health.
The arrangements made in 1 Sam 16:16-20 would have been made by the king's servants with little or no input from Saul. In fact, Saul may not have even been introduced to David as Saul was becoming increasingly remote and detached.
Ellicott, Benson and others discuss this here and arrive at similar conclusions >> https://biblehub.com/commentaries/1_samuel/17-55.htm
Well if you recall Samuel was afraid of being killed by Saul when Samuel was ordered by God to go to the house of Jesse to anoint a new King over Israel and this anointing was only between Samuel, David and God, for not even Davids brothers or parents knew about it. This explains why Davids older brothers, who were in Sauls Army, treated David as insignificant.
So Samuel new that he had to wait for Saul to die before he could advise David about being King but Samuel ended up dying shortly after he anointed David. And David was the youngest of 8 boys and only 3 were of military age (20 or older) so how old David actually was when he was anointed is not clear but he was called a "child" in the oldest version (1539) of Samuel (which is under 17 or younger) not a youth, (which would be close to 20 years old but not 20). And 20 or older would mean your a "man" or "able bodied man).
So fear of King Saul, the anointing being only know by Samuel, God and David: David being only a child, and the Samuel's death shortly after all played a role in why Davids anointing was the way it happened.