The Korahite family of Levites held a vital and continuous responsibility throughout early Jewish history, serving as the dedicated guards of the sacred spaces. This duty was passed down through the generations, beginning in the desert and continuing into the era of King David. The lineage of Shallum, a key figure in this family, traces back to Ebiasaph, the son of Korah. It is likely that Shallum was a descendant of Heman the singer, with the historical record simply condensing the generations between him and Ebiasaph [רד״ק]. Shallum and his relatives [מצודת דוד, שטיינזלץ] were officially appointed to manage the daily operations of the holy site.
Their practical job was to guard the thresholds, or doorposts, of the sanctuary [מצודת ציון, רלב״ג]. During the reign of King David, they stood watch at the gates of the Tent of Meeting [שטיינזלץ]. The primary goal of this security was strict: to prevent anyone unfit from entering the sacred grounds. The primary approach among commentators is that they protected the entrances to the courtyard and the Tent of Meeting, ensuring that only priests could enter to perform their duties [רש״י, מצודת דוד]. However, another perspective suggests that their guard duty was even more central, positioned directly at the doorposts of the Holy of Holies itself [רד״ק].
The work of Shallum and his family perfectly mirrored the role of their ancestors during the years the Israelites spent in the desert. Just as Shallum guarded the gates during the time of King David, his forefathers stood watch at the entrances to the camp of God [מצודת ציון]. They protected the camp of the Divine Presence to keep unauthorized individuals from wandering in [מצודת דוד, רלב״ג, שטיינזלץ]. This role was a direct continuation of the historical mandate given to the family of Kohath, Korah's ancestors. In the desert, the family of Kohath carried the Ark and the holy vessels, guarding the inner entryways so that ordinary people would not gaze upon the sacred objects [רד״ק].
Overseeing these ancient guard shifts was Phinehas, the son of Eleazar the priest. Tradition holds that Phinehas lived an unusually long life, surviving from the Exodus from Egypt all the way to the days of King David, which was exactly when these specific Levite guard shifts were formally established and organized [רלב״ג].