Numbers 3 opens with the generations of Aaron and Moses. Aaron's sons Nadab and Abihu died when they offered strange fire before Yahweh, and they had no children. Eleazar and Ithamar continued as priests. God then commanded that the tribe of Levi be brought near and given wholly to Aaron and his sons, to keep the requirements of the tabernacle on behalf of the congregation.
Unlike the other tribes, the Levites were counted from a month old and upward, numbering 22,000. The Gershonites camped west and cared for the tent, its coverings, and its screens. The Kohathites camped south and cared for the ark, table, lampstand, altars, and holy vessels. The Merarites camped north and cared for the boards, bars, pillars, and sockets. Moses and Aaron camped east, guarding the entrance.
The deeper reason was redemption. For all the firstborn are mine. On the day that I struck down all the firstborn in the land of Egypt I made holy to me all the firstborn in Israel. The Levites now stood in place of Israel's firstborn. The 273 firstborn in excess of the Levites were redeemed for five shekels each. The New Testament speaks of believers as redeemed not with silver or gold but with the precious blood of Christ (1 Peter 1:18-19), and the church is called the assembly of the firstborn (Hebrews 12:23).