Thank you for the question on canonicity of the Bible.
Since l have addressed this question on other occasions, here are some thoughts for one’s consideration:
A. The authorship of the scroll or text.
The priests and scribes preserved the Old Testament Scriptures based on the oral tradition that the writer of that scroll was a prophet of God. This is equally the same for the New Testament writer as being an apostle or under his guidance.
B. The carbon dating of the scroll.
Archaeologists and scientist would date the site and the material on which the text was written on as the Dead Sea Scrolls.
C. The lettering of the scroll or text.
As a scroll is unrolled, the content of the text is closely examined as to the letters and style of writing that compares with that time period.
D. The content of the scroll or text.
As the content is read, the message of the content is evaluated as to its teaching.
E. The consistency of the scroll or text with other Biblical text.
As one reads the text, the message of the text is examined as to its consistency with other texts. There is an acceptance of transcribed letters but not Biblical or theological inconsistencies. There is the comparison of scrolls or parchment.
One can read more on the topic of canonicity, we have modern technology to help us in ascertaining the age and content of the scroll.
For the Jewish scribes and the early Christians, they had a high reverence for the Scriptures which they viewed as being the words of God to his people.
As to the Pseudepigrapha and Apocrypha Books, one can read online about the various views on each book. As one reads them, one can come to their own conviction whether a particular scroll should or should not be part of the Scriptures.
Summary: The authorship, content, and consistency with other Scriptures were determining factors in assessing whether that scroll should or should not be part of the Bible.
For more perspectives:
https://www.quora.com/How-were-the-books-in-the-Bible-chosen