The original three-volume edition of The Lord of the Rings contains six internal books.
Tolkien’s work is commonly described as a trilogy because it was published in three physical volumes: The Fellowship of the Ring, The Two Towers, and The Return of the King. However, the narrative itself is divided into six books, plus appendices.
The first volume contains Books I and II, the second contains Books III and IV, and the third contains Books V and VI. Tolkien preferred to regard the work as one long novel rather than a trilogy, but paper shortages and publishing arrangements contributed to the three-volume format.
This distinction explains why both “three” and “six” appear in discussions of the structure. Three is the number of published volumes in the familiar edition; six is the number of numbered internal books. The appendices add genealogies, chronologies, languages, and historical material.