I Chronicles - Chapter 23
Let's Settle Down Together
David was advanced in age, so he appointed Solomon to rule in his stead. (The full details behind the transfer of power are given in the first chapter of Kings.) David divided the Levites into the various duty groups responsible for administering to the sacrifices, guarding the Temple, playing the instruments, etc. (Verses 6-24 contain the genealogy of the Levites.)
David said that since G-d has given the nation rest in the land, He will likewise "rest" in Jerusalem (i.e., in the permanent Temple, as opposed to the portable Tabernacle). Because of this, the Levites would no longer have to transport the holy vessels. Instead, they would care for all the needs of the Temple. In addition to tending to the facility and supplies of the Temple, they would sing Psalms to G-d every morning and evening, as well as accompanying sacrifices on special days. They have all these responsibilities in order to facilitate their brothers the kohanim (priests) in carrying out the Temple service. (The kohanim are their brothers because they, too, are descended from Levi.)