Moses numbered the people to find the number of firstborn among the children of Israel. God said the firstborn belonged to Him. He took the tribe of Levi in place of taking all the firstborn.
The Levites took care of the tabernacle. They spent their lives in service of the Lord.
There were more firstborn than Levites. They redeemed the number of firstborn over the number of Levites by giving money to Moses and Aaron.
Numbers 3:45, 46, “Take the Levites instead of all the firstborn among the children of Israel….the Levites will be mine. I am the Lord. For those who are to be redeemed…” Modern English Version
Firstborn children received a double part of their father’s inheritance. God blesses the redeemed and those in His service.