Vayikra / Leviticus 27:32 · Pshat
וְכָל־מַעְשַׂר בָּקָר וָצֹאן כֹּל אֲשֶׁר־יַעֲבֹר תַּחַת הַשָּׁבֶט הָעֲשִׂירִי יִהְיֶה־קֹּדֶשׁ לַיהוָה׃
And every tithe of the herd and the flock, all that passes under the staff, the tenth shall be holy to the Eternal.
Pshat פְּשָׁט
Under the staff
How can one fairly set aside a tenth of the flock when the owner always wants to keep the best? The Torah gives a simple method.
Rashi: the tithe is set aside like this: the animals are led out through an opening one by one, and every tenth is marked with a staff dipped in red paint. It is holy: the blood and fat are brought to the altar, and the owners eat the meat. Netziv: the verse teaches that setting aside the animal tithe is a commandment. HaKtav VeHaKabbalah: the lambs pass by themselves: the mothers stand outside, and the young come out at their voice.
How Rashi, Haamek Davar, and HaKtav VeHaKabbalah explain it
Rashi Under the staff
When he comes to tithe them, he leads them out through an opening one after another, and the tenth he strikes with a staff painted with red paint, so that it is seen to be the tithe. So he does with the lambs and calves of each year.
Rashi Shall be holy
To offer its blood and its altar portions on the altar, while the owners eat the meat, for it is not listed among the other gifts to the kohanim, and we do not find that it was given to the kohanim.
Haamek Davar And every tithe
The word "tithe" is superfluous, and the verse would lack nothing as "And all the herd and the flock, all" and so on, "the tenth" and so on. The sages have already expounded this. But by the simple sense, had it been written so, I would say there is no commandment to pass the animals under the staff in order to set aside the tithe, only if one passes under the staff by itself. Therefore it is written "And every tithe" and so on "shall be holy," that is, the tithe of his flock and herd is holy. And Scripture explains how the tithe becomes holy: not that he takes it himself, but "all that passes" and so on. But in any case, giving the tithe is a commandment.
HaKtav VeHaKabbalah Passes
Passes by itself, not that he leads them out by hand. How does he do it? He sets their mothers outside, and they bleat so that the lambs hear their voice and come out of the pen towards them (Bekhorot 58b). And Rashi, who wrote here "he leads them out through an opening one after another," does not mean that he leads them out by hand, but only in this way.
Takeaway
Onkelos renders "staff" as חֻטְרָא, "rod," and keeps the verse simple: the tenth animal that passes under the shepherd's rod is holy.
The animal tithe (מַעְשַׂר בְּהֵמָה) was brought to the Temple, and its meat was eaten by the owners themselves in Jerusalem. So Rashi says it is not a gift to the kohanim.