At some point after Mormon finished writing the last chapter, he gave the plates containing the Book of Mormon to Moroni. Mormon had finished what he had intended to write, which covered from the time of Lehi to his final words to future descendants of the New World house of Israel after the destruction of the Nephite nation at Cumorah. At this point, the Book of Mormon did not include the book of Ether, and certainly not the book of Moroni. It would have included the small plates, probably as an appended record.
Moroni indicates that his father did command that he write a few things, and so we have Moroni’s voice at the end of Mormon’s personal book. In the 1830 edition, our two chapters containing Moroni’s words were a single chapter.