Levi's three sons, Gershon, Kohath, and Merari, had become the heads of their own clans.
(SEE 46:8)
David then divided the Levites into three groups according to the clans of Levi's sons, Gershon, Kohath, and Merari.
So Moses obeyed and counted them.