I Chronicles 23 is about the Levites. The Levites assisted the Aaronic priests. In the Book of Numbers, their primary responsibility was transporting the holy objects (i.e., the Tabernacle, the Ark of the Covenant, etc.) from place to place, since Israel was on the move from Egypt to the Promised Land. Even after Israel arrived in the Promised Land, there were times when holy objects needed transporting—-when the location of the sanctuary changed, or when the Israelites went out into battle and took the Ark of the Covenant with them—-and, in those cases, the Levites were the ones who were supposed to transport the holy objects.
According to Numbers 4:35, Levites between the ages of 30 and 50 were the ones who were to serve. Numbers 8:24 says that the starting age is 25, and rabbinic sages sought to harmonize this contradiction (or apparent contradiction) by positing that Levites began their training at age 25 but actually started serving at age 30. Why age 30? David Rothstein in the Jewish Study Bible proposes that the idea is that, during the wilderness journey, the Levites needed strength to carry the Ark and enough experience to transport the holy objects correctly, as mishandling the holy objects could bring death. In light of this, 30-50 is a good age range, since people in that age range have arrived at a state of strength, experience, and maturity.
David in I Chronicles 23 initially numbered the Levites over thirty and assigned to them responsibilities: being officers, judges, and gatekeepers, praising God with instruments, and assisting in the sanctuary itself. But David then decided to enroll the Levites between 20-29, as well. The reason for this is given in vv 25-26: the Israelites are now at rest, and they are no longer on the move. Consequently, their sanctuary is not on the move, and so the Tabernacle and its vessels no longer need to be transported by the Levites. The text does not say why specifically this is relevant, but some have proposed that David’s reasoning is that the serving Levites no longer need to be in the 30-50 age range, the best age range for transporting the holy objects, for the Levites no longer needed to transport holy objects. Another rationale may have been that David was expecting the Temple to be larger than the Tabernacle and thus to require more men to support it: you reduce the starting age for Levitical service, and you have more Levites serving!
David Rothstein in the Jewish Study Bible proposes that perhaps Israel’s post-exilic setting—-the milieu in which the Book of Chronicles was composed—-explains why I Chronicles 23 presents the starting age for Levitical service being lowered. Ezra 8:15-20 seems to indicate that post-exilic Israel had difficulty finding Levites; thus, it would make sense that requirements for Levitical service would become a bit looser at that time. I Chronicles 23 itself does not present a dearth of Levites, but perhaps it addresses the need of post-exilic Israel: post-exilic Israel needed Levites for service and thus felt a need to lower the starting age, and I Chronicles 23 depicted an important figure in Israel’s history, King David, doing precisely that.