The Book of Mormon is rich with themes, names and geography that were common in daily life in New England during Joseph's life. There is a significant amount of content in the Book of Mormon that was taken from the Bible, The View of The Hebrews and the Spaulding Manuscript. Joseph likely combined these sources, with some help from Oliver and/Or Sidney to produce the Book of Mormon. Nobody ever saw Golden Plates except for with their "spiritual eyes", which leads me to believe the Gold Plates did not exist. Although I cannot definitely say how the Book of Mormon was produced, I'm 100% certain it is a modern production and not of ancient origin.
Aside from the parts copied from his version of the bible, the book was written by scribes as dictated by Joseph Smith. He was known as a particularly good orator and often gave sermons for hours without any prepared notes. He also practiced telling stories about native Americans as a teen based on legends of the mound-builders of Hebrew heritage which, per his mother, entertained his family for hours. He borrowed stories like Lehi's vision of the tree of life from his father's experience and contemporary religious themes (like baptism of infants) from local preaching. His deep immersion in a biblical/ magical christian community may have been a source for some hebraisms (such as names and chiasmus) as they continue to appear in subsequent revelations.