We know that David actually existed. I forget what it is, but we have an archeological find with the words "House of David" inscribed on it. So that's not the question.
Rather, the question is, how do you know which stories about a historical figure actually happened and which are legends? I mean, do YOU believe that George Washington chopped down a cherry tree?
For me the verification comes first and foremost from God's ability to never shy away from the ugly human nature as well as the good that His Spirit promotes in us.
In the case of David if the intent is to concoct legend making stories about a hero for the nation Israel like David , why would you include a story depicting him as a adulterer and a murderer ?
Why would you include a story about Moses being a murderer ?
If legend status creation is what you are after in your story making?
Accordingly there is no "Cherry Tree" aspect of "Legend" making seen in God squashing Daivd's hopes to build the Temple because he is " bloody man"
This is God speaking.
The story of George Washington and the Cherry Tree, on the other is a typical example of man's timeless penchant for using a lie to promote & puff himself up.
We were recently treated to a modern day version of the Cherry Tree incident when the recently defeated VP candidate attempted to puff himself up by claiming he carried weapon into a war zone when it was shown he never did any such thing and he then was forced to admit the lie by saying it was a case of himself using " bad grammar" ( Tim Walze) lol.
This is the flesh speaking.
Not quite as creative a man made story as , " yes I smoked marijuana , BUT I NEVER INHALED" ( Bill Clinton) but still worth a laugh.
The motives and the ideals of bringing heaven down to earth are contained in the truth of God's Words.
It has properties possessed by no human fabricated story designed to create "legend"
The Word of God is Living my friend.
It is instinct with the life of it's Divine source, from which it is never divorced.
It's promises can never fail , it's threatenings never prove idle.
It has within itself a living , quickening, life communicating force.
Kind Regards