1 Chronicles 26:1-32
The divisions of the gatekeepers: From the Korahites: Meshelemiah son of Kore, one of the sons of Asaph.
All these were descendants of Obed-Edom; they and their sons and their relatives were capable men with the strength to do the work—descendants of Obed-Edom, 62 in all.
These divisions of the gatekeepers, through their leaders, had duties for ministering in the temple of the Lord, just as their relatives had. Lots were cast for each gate, according to their families, young and old alike.
Their fellow Levites were in charge of the treasuries of the house of God and the treasuries for the dedicated things.
Some of the plunder taken in battle they dedicated to the repair of the temple of the Lord.
Why?
For the protection of the Temple, many things need servants to protect and serve the Lord.
Obed-Edom in the time of David and Saul, they keep the ark of the Lord in their land.
Lots is a fair job distribution and devotion before the Lord and human beings.
How?
Even the result of the Lord is in the hands of the Lord.