For all the firstborn among the people of Israel are mine, both of man and of beast. On the day that I struck down all the firstborn in the land of Egypt I consecrated them for myself, and I have taken the Levites instead of all the firstborn among the people of Israel. And I have given the Levites as a gift to Aaron and his sons from among the people of Israel, to do the service for the people of Israel at the tent of meeting and to make atonement for the people of Israel, that there may be no plague among the people of Israel when the people of Israel come near the sanctuary. – Numbers 8:17-19 (ESV)
The Lord is not taking what is His, namely, He is taking a tribe (1/13th of all the people) instead of the firstborn of every Israelite. Then the Lord gives the Levites for sanctuary service so that the people of Israel can be close to Him. A needy people, a gracious and generous God.