A list of David’s key staff and Levite priests; David looks after Mephibosheth (Jonathan’s son), then defeats the Ammonites and their allies: 2 Samuel 8:15–18; 1 Chronicles 18:14–17; 1 Chronicles 6:16–30; 1 Chronicles 6:49–53; 1 Chronicles 6:31–48; 2 Samuel 9–10:19; 1 Chronicles 19:1–19
Whoever wrote Chronicles had a reliable historical source to draw on. There are just too many names and numbers and other details for it to have been an oral tradition. Strictly speaking, the author is anonymous because he didn’t name himself; but the theories about authorship range from an anonymous levitical scribe to Ezra.
In this case, the court historian is identified (he probably wrote some of the source material):
1 Chronicles 18:15-17 Joab son of Zeruiah was commander of the army. Jehoshaphat son of Ahilud was the royal historian. Zadok son of Ahitub and Ahimelech son of Abiathar were the priests. Seraiah was the court secretary. Benaiah son of Jehoiada was captain of the king’s bodyguard. And David’s sons served as the king’s chief assistants.
More amazingly, the author of Chronicles left him in the record. Other sources were identified in a summary of King David’s reign:
1 Chronicles 29:26-30 All the events of King David’s reign, from beginning to end, are written in The Record of Samuel Seer, The Record of Nathan the Prophet, and The Record of Gad the Seer. These accounts include the mighty deeds of his reign and everything that happened to him and to Israel and to all the surrounding kingdoms.
A few other comments
The key here is to not get too hung up on the placement of a comma, or the grammatical construction of a noun phrase, but to look at what the text is trying to say. The discrepancies in numbers of people, chariots, horsemen and so on are are dealt with in this table. The issue usually comes down to an extra or missing zero, and it is sometimes attributed to scribal error: does it really change who God is, thousands of years after the fact, whether there were 700 or 7000 horsemen, especially given the overall issues with issues around translations of biblical numbers. Other discrepancies are not discrepancies: they were counting different objects or using different methods to do the calculations.