1 Chronicles 23:2

And he gathered together all the princes of Israel, with the priests and the Levites.

The gathering took place when David was old and full of days, after Solomon had been placed upon the throne. All the princes of Israel were brought together with the priests and the Levites in order to perfect the organization of every branch of service, embracing the ministration of the priests and Levites, the civil officers, and the army. In this the carrying out of a carefully studied plan was seen, by which to each man was apportioned the special duty for which he was best fitted. Connected with this organization the Levites from thirty years old and upward were numbered at thirty-eight thousand, of whom twenty-four thousand were to set forward the work of the house of the Lord, six thousand were to be officers and judges, four thousand were porters, and four thousand praised the Lord with instruments.