Whether as the brave youth striding forward to face the giant Goliath, the wise older king composing the immortal Psalms, or the ancestor and model for the messiah, the legend of David has been recited and burnished for nearly three thousand years. Politically, ethnically, religiously—David is central to the story Jews and Christians tell about themselves.

This is, after all, the king against which all other kings were measured, the ancestor of Jesus, the person described by God as “a man after my own heart.” Even in his failings—the affair with Bathsheba, most famously—David has become the prototype of repentance and divine forgiveness.

But what would it mean if the story we tell about David wasn’t true? The Bible, after all, isn’t a historical document—the modern notion of objective history writing was invented only recently. It is, rather, a theological and political statement, with all the biases such texts always have. When we try to understand what the biblical authors were trying to do, and when we correlate the story of David with what we know about that period from archaeology and other historical disciplines, we gain access not to the legendary David, but to the historical one.

Some of the revelations aren’t so surprising. Even if you believe in giants, the story of Goliath was probably too good to be true. There’s also the problem that, even in the Bible itself, the killing of a Philistine giant named Goliath is attributed to an entirely different character, an otherwise unknown warrior named Elhanan.

As for the Psalms, the Bible never says that David wrote them. Actually, it would be about a millennium after David lived that anyone proposed that he was the author of the Psalms. And for all his legendary traits, most people don’t think David was a prophet, which makes the Psalms that refer explicitly to events hundreds of years after David somewhat problematic: “By the waters of Babylon we lay down and wept …”

None of this diminishes the power of the text. The David and Goliath story remains as good a metaphor as has ever been created (so good that Malcolm Gladwell, in his new book David and Goliath, felt the need to challenge it). The Psalms remain the language of joy and sorrow for people everywhere.

David did a lot of the things he’s famous for: he did rise from humble beginnings to become king; he did create a new nation; he did inaugurate Jerusalem as a religious center. But to achieve these results, he had to sacrifice virtually all of the values that we want to imagine that our heroes embody.

The Bible does a remarkable job of making it seem completely natural that David should have gained the throne. Through stories of David’s popular appeal, his conflict with his predecessor Saul, his unorthodox relationship with Jonathan, the authors make the case that David practically fell into the kingship: he never wanted it, he never did anything to try and gain it, and yet, against all odds, he got it. But how does someone become king when he’s a complete nobody, from a backwater town in a backwater province, and when, most importantly, he’s not even remotely part of the royal line? The Bible wants us to believe that all the most unlikely things happen to kids from Bethlehem.

The clues to how David came to power are there to be found. The corpses of the entire preceding royal family litter the narrative. Though the Bible is quick to emphasize, again and again, that David had nothing to do with those deaths, wasn’t even in the same place when any of Saul’s family died. But even the biblical authors admit that David was working for the Philistines, Saul’s enemies, just before the battle in which Saul and his son Jonathan perished, and that David, a mere day or two after Saul’s death, held the dead king’s crown in his hands. And there is the even more disturbing realization that for the first seven years of David’s reign the Philistines seem to have kept unusually quiet. It’s no wonder the Bible goes to such lengths to proclaim David’s innocence.

David created a new state out of the previously disorganized settlements of Judah. From that base he proceeded to take command of the northern territory of Israel, bringing both under a single crown for the first time. The Bible makes this out to be a matter of popular acclaim, the people lining up to have David as their ruler. Readers are supposed to love David just as his people did. But David actually took command by force: like a modern-day third-world dictator, he led a private militia of veteran mercenaries answerable only to him, one that was easily able to overpower any opposition.

David made Jerusalem into a national and religious center, as tradition holds. But he didn’t build it from the ground up; he took it, displacing its ancient native inhabitants. If we feel ambivalence about the legacy of Christopher Columbus—David is in the same boat. And David didn’t found a completely new religious site; he brought his army and took the ark of the covenant from its local sanctuary. Imagine George Washington forcibly taking the Liberty Bell from Philadelphia when he moved the capital to the District of Columbia; now imagine that people thought the Liberty Bell was the throne of God, and you’ve got the idea.

The people didn’t love David—they couldn’t wait to get rid of him. They even came together to force David off the throne for a brief period. But it turns out that a professional private militia beats a volunteer army of farmers almost every time, especially when supported by a network of loyal spies. David’s desperation to keep the throne is apparent from the fact that the leader of this populist uprising was his own son, Absalom—and yet David did not spare him the sword. (While the Bible depicts David as heartbroken over Absalom’s death, undoubtedly David gave the order; Absalom, after all, was trying to kill David, too.) The people of Israel surely realized that if a rebellion led by David’s son and supported by the populace at large couldn’t succeed, they were out of options. They were stuck with David, whether they liked it or—as was in fact the case—not.

What does it mean for us to ascribe legendary status to a man who falls into the categories of murderer, traitor, and usurper? We have invested so much cultural capital in David over the last three millennia. What do we do when our idealized founding figures—against whom we measure ourselves and who help define us, their descendants—turn out to be far less than ideal?

Maybe—among other things—discovering the truth about David can be a reminder that there is potential danger in blindly valorizing the world of the Bible, in longing for a return to supposedly purer times, and in creating legends out of mere mortals.