I'm thinking, since it wasn't written down until centuries after it supposedly happened, that the most likely answer is that it was just bullshit.
The closest evidence we have to David even existing is a tablet caved by someone who [may have] claimed to be of the House of David.