Because of context. Historians studying that author or piece of text can collect a wide range of evidence such as:
– Other sources from different people that corroborate authorship. So if Plato wrote something, and then Aristotle later was like “yeah Plato wrote that,” that’s more evidence that Plato indeed wrote that.
– Consistency in the author’s works. If the writing style is the same, and if the author frequently references ideas/themes from that text in their later works, that’s more evidence that they indeed wrote that text.
– They found the original document in the author’s house/tomb/place they lived/place associated with them. If I open your casket and your skeleton is clutching a “A Treatise on the Human Condition, by /u/PresentationGold9081” then yeah you probably wrote that.
Latest Answers