Answers to Quora Questions by Yair Davidiy
During King David's reign, were all men soldiers?
https://www.quora.com/During-King-Davids-reign-were-all-men-soldiers/answer/Yair-Davidiy
In times of emergency all males between the ages of 20 to 60 served in the armies of Israel. Yigal Yadin was the second Israeli IDF Chief of Staff and a noted archaeologist. Yadin suggested, based on Biblical verses, that the Ancient Israelites had a kind of permanent rotational system similar to the Annual Military Reserve Duty Service ("Miluim") now practiced in Israel with the IDF. Yadin also opined that each Tribe had its own military specialty.
Members of the Tribe of Levi (parallel to the Hareidim of today) however did not serve and did not go out to war.
Numbers (NKJV) 2:
33 But the Levites were not numbered among the children of Israel, just as the LORD commanded Moses.
"Numbering" from the age of twenty meant be appointed for military service. The Levites were not so numbered since they did not serve in the Amy of that time. The Levites were appointed to serve God alone.
Deuteronomy (NKJV) 10:
8 At that time the LORD separated the tribe of Levi to bear the ark of the covenant of the LORD, to stand before the LORD to minister to Him and to bless in His name, to this day. 9 Therefore Levi has no portion nor inheritance with his brethren; the LORD is his inheritance, just as the LORD your God promised him.