1 Chronicles 23:6

And David divided them into courses among the sons of Levi, namely, Gershon, Kohath, and Merari.

David divided the Levites into courses by the sons of Levi, namely Gershon, Kohath, and Merari. This dividing belongs to the history of David in Chronicles, where he established the worship of God and prepared for the temple that Solomon would build.

Within that history it supplies new and important facts left out of Samuel and Kings, while taking knowledge of those earlier books for granted. Its genealogy of the Levitical courses was kept because after the exile strict legal proof of hereditary descent was needed, so that the land could be assigned to its hereditary owners and the temple service could be taken up by those whose hereditary duty it was.