The Israelites were commanded and encouraged to give various types of contributions. The first reference to giving in the Law of Moses is a comment about giving God the firstfruits:
You shall not delay to offer from the fullness of your harvest and from the outflow of your presses. The firstborn of your sons you shall give to me. You shall do the same with your oxen and with your sheep: seven days it shall be with its mother; on the eighth day you shall give it to me.
(Exodus 22:29-30)
This reflects the principle that the firstborn belongs to Yahweh (Exodus 13:1), which was also expressed in the tenth plague of Egypt: the Death of the Firstborn.
The last part of the Book of Exodus is concerned with the construction of the Tabernacle. This was to be funded by freewill offerings:
The Lord said to Moses, “Speak to the people of Israel, that they take for me a contribution. From every man whose heart moves him you shall receive the contribution for me. And this is the contribution that you shall receive from them: gold, silver, and bronze ... And let them make me a sanctuary, that I may dwell in their midst.
(Exodus 25:1-3, 8)
This is indeed what happened:
And they came, everyone whose heart stirred him, and everyone whose spirit moved him, and brought the Lord's contribution to be used for the tent of meeting, and for all its service, and for the holy garments. So they came, both men and women. All who were of a willing heart brought brooches and earrings and signet rings and armlets, all sorts of gold objects, every man dedicating an offering of gold to the Lord.
(Exodus 35:21-22)
It is highly significant that the first offerings given were from peoples' hearts being stirred: this was meant to be a joyful response to the salvation they had just experienced. This is identified as a “freewill offering” (nedabah), a word used throughout the Mosaic law:
All the men and women, the people of Israel, whose heart moved them to bring anything for the work that the Lord had commanded by Moses to be done brought it as a freewill offering to the Lord.
(Exodus 35:29)
Many of the sacrifices described in Leviticus were like this; they were not obligatory, but if they were offered, they had to be offered according to strict rules:
And when anyone offers a sacrifice of peace offerings to the Lord to fulfill a vow or as a freewill offering from the herd or from the flock, to be accepted it must be perfect; there shall be no blemish in it.
(Leviticus 22:21)
The law of the tithe comes right at the end of Leviticus, in the context of rules about vows.
Every tithe of the land, whether of the seed of the land or of the fruit of the trees, is the Lord's; it is holy to the Lord. If a man wishes to redeem some of his tithe, he shall add a fifth to it. And every tithe of herds and flocks, every tenth animal of all that pass under the herdsman's staff, shall be holy to the Lord. One shall not differentiate between good or bad, neither shall he make a substitute for it; and if he does substitute for it, then both it and the substitute shall be holy; it shall not be redeemed.
(Leviticus 27:30-33)
“Tithe” means a tenth (10%). Although many have been fixated with this number, it is a bit more complicated than this. It could be redeemed, so that instead of giving fruit, a man could give money instead – but in this case, it would be increased to 12%. Conversely, every tenth animal had to be given to Yahweh, so someone with 29 animals would give two, which works out to a bit less than 7%. Sometimes people have emphasized the tithe as giving the “first 10%” to God, but the text does not say this. Nor, indeed, does it suggest giving the “best 10%” to God – every tenth animal was to be given, regardless of condition.
In fact, the passage does not talk about “giving” the tithe to Yahweh at all – it says that it already belongs to him. And it doesn't explain what actually happens to the fruit and the animals. In Numbers 18, we learn that the tithe was given to the Levites:
To the Levites I have given every tithe in Israel for an inheritance, in return for their service that they do, their service in the tent of meeting.
(Numbers 18:21)
The Levites were also obliged to tithe this income, this time to the priests:
When you take from the people of Israel the tithe that I have given you from them for your inheritance, then you shall present a contribution from it to the Lord, a tithe of the tithe. And your contribution shall be counted to you as though it were the grain of the threshing floor, and as the fullness of the winepress. So you shall also present a contribution to the Lord from all your tithes, which you receive from the people of Israel. And from it you shall give the Lord's contribution to Aaron the priest.
(Numbers 18:26-28)
It should be noted that the Levites' work was not restricted to the tabernacle: they were also to function as teachers of God's law:
They shall teach Jacob your rules and Israel your law;
They shall put incense before you and whole burnt offerings on your altar.
(Deuteronomy 33:10).
A further set of commands regarding tithes is given in Deuteronomy:
You shall tithe all the yield of your seed that comes from the field year by year. And before the Lord your God, in the place that he will choose, to make his name dwell there, you shall eat the tithe of your grain, of your wine, and of your oil, and the firstborn of your herd and flock, that you may learn to fear the Lord your God always. And if the way is too long for you, so that you are not able to carry the tithe, when the Lord your God blesses you, because the place is too far from you, which the Lord your God chooses, to set his name there, then you shall turn it into money and bind up the money in your hand and go to the place that the Lord your God chooses and spend the money for whatever you desire—oxen or sheep or wine or strong drink, whatever your appetite craves. And you shall eat there before the Lord your God and rejoice, you and your household. And you shall not neglect the Levite who is within your towns, for he has no portion or inheritance with you.
(Deuteronomy 14:22-27)
This modifies the use of the tithe that we saw in Numbers 18:21; feasting and celebration are part of how the tithe would be spent. Once again, however, the Levites are mentioned as the recipients. Although many scholars have seen this as a second tithe, it is best to see this as the same tithe discussed in Leviticus 27, although wine and oil were not mentioned in that passage.
The verses that follow should similarly not be seen as an additional tithe:
At the end of every three years you shall bring out all the tithe of your produce in the same year and lay it up within your towns. And the Levite, because he has no portion or inheritance with you, and the sojourner, the fatherless, and the widow, who are within your towns, shall come and eat and be filled, that the Lord your God may bless you in all the work of your hands that you do.
(Deuteronomy 14:28-29)
This tithe also paid for feasting, but the differences are that it is local (“within your towns”) rather than national (“in the place that he will choose”) and that the poor are explicitly included in the feasting rather than just the Levites.
Thus, tithing in the Mosaic law is somewhat different to what is often assumed. It was for religious purposes, but that included both feasting before Yahweh, as well as financially supporting the Levitical ministry.