We don't know who wrote these texts
In a court of law, if we were to assert that someone was the author of a work, we would need to provide proof. Self testimony is generally sufficient proof, but less so if the person is dead (and there is a dispute about whether the text was written within their lifetime or not). We could also look at their writing style and compare it to works that we definitively know were written by them, or ideally we could produce eyewitnesses who saw them write the text (or in modern times, unaltered video footage of them doing so).
When discussing ancient texts, we generally don't have this level of proof. Granted, we aren't discussing texts in an effort to defend them in a court of law, but we still should be careful about what assumptions we make about authorship. This can be confusing because many books are commonly named after their presumed author (such as the Gospels), but scholars disagree on whether or not the Gospels' namesakes are truly their authors. It is OK to limit the scope of a question by assuming certain authorship, but this assumption should be stated as such (e.g. "Assuming John wrote the fourth Gospel, what...?").