Bechoros, chapter 9, Mishnah 4. The Mishnah establishes that all animals born to a person enter the pen once a year to be tithed. "Hakol" - Everything, even animals that are unfit for an offering: a blemished animal is not offered on the altar, but nevertheless, it enters the pen and is counted as one of the ten. If the blemished animal emerges tenth, it is eaten in its place - it is not brought to the Temple, and it is not offered as a tithe offering.
What the word "Hakol" comes to include:
The word "Hakol" also includes animals that are disqualified from being an offering due to a halachic disqualification, as they too are counted with those entering the pen and become part of the tithed flock. According to the Gemara's exposition, the Tanna is referring to eight matters, which come in four pairs:
Rovea venirba - An animal that participated in bestiality, whether male or female. This animal is disqualified for an offering, and nevertheless, it enters the pen to be tithed.
Muktzeh vene'evad - Muktzeh is an animal that was set aside to be offered for idol worship but was not actually offered (for if it had been offered, it would be forbidden for any benefit). Ne'evad is a live animal that was itself worshipped as an idol. These too are disqualified for an offering, yet they enter the pen's count regarding the animal tithe.
Esanan umechir kelev - Esanan is the payment a person gives to a prostitute; if he gave her a sheep, that sheep is disqualified from serving as an offering. Mechir kelev refers to one who exchanges a sheep for a dog, in which case that sheep is also disqualified from serving as an offering. These two disqualifications are from the Torah, and they are counted among the 613 mitzvos, and yet the animals enter the pen as part of the tithe.
Tumtum ve'androgynos - According to the Tanna in our Mishnah, they are of doubtful gender: the tumtum's genitals are covered by a membrane and it is not apparent whether it is male or female, and the androgynos has both male and female genitals. Regarding tithing, this doubt makes no practical difference, since the firstborn law applies only to males, whereas the animal tithe applies equally to males and females.
It is worth noting that the halachah is decided on the last point according to the view of the Sage, that the androgynos is a gender unto itself, and therefore it is exempt from the tithe; however, this is not the point before us here.
"Chutz min hakilayim, vehatereifah, veyotzei dofen, umechusar zeman, veyasom" - Except for a crossbreed, a torn animal, one born by cesarean section, one lacking time, and an orphan:
Although these eight types of animals enter the pen, along with all the other animals - the cows, the goats, and the sheep - five animals are exempt from entering and being tithed. The basis for these five exemptions is midrashic, and is derived from the verses.
The starting point is a gezeirah shavah on the word "tachas" (under). Regarding the animal tithe, it says that all the animals pass "tachas hashevet", meaning under the staff, and they are counted, and the tenth is marked with red paint. In Parashas Emor, in the passage dealing with offerings in general, the word "tachas" also appears, and the gezeirah shavah is derived from it.
This is the wording of the verse (Vayikra 22:27), and from it the exemptions are derived:
"Shor o chesev o ez" - Specifically these three species of animal, to exclude kilayim (a crossbreed): a mixed animal born from a goat mother and a sheep father, or conversely, from a he-goat father and a ewe mother, is exempt.
"Ki yivaled" - The birth itself excludes an animal that was not born in the normal manner but was extracted from its mother's side, which is yotzei dofen (cesarean section), and it is exempt not only from being offered as a sacrifice but also from the tithe.
"Vehayah shivas yamim tachas imo" - The word "tachas" is the source of the gezeirah shavah. The seven days teach that during its first seven days, the animal is not fit for an offering, and it is lacking time until it is eight days old. And the words "tachas imo" teach that it must have a mother, and if it has no mother, it is exempt. The meaning of "it has no mother" in our context is that the mother was not alive at any stage of the offspring's life, such as if she died during birth, and the calf, kid, or lamb never had a living mother.
"Umiyom hashmini vahal'ah yeratzeh lekorban isheh laShem" - From the eighth day onwards, the animal is fit for a fire-offering to Hashem.
The five exemptions in their order in the Mishnah:
Everything enters the pen to be tithed: all animals, cows, goats, and sheep, that were born in the past year from the first of Elul until the first of Elul, are brought into the pen to be tithed, and even blemished animals and even those that have the eight halachic disqualifications. And these are the exemptions:
Kilayim - an animal that is the offspring of a he-goat and a ewe, or vice versa.
Tereifah - an animal that has one of the defects that will cause it to die within its first year. The Mishnah in Tractate Chullin, in the third chapter, lists eighteen types of tereifos. One of them is an animal whose leg was severed above the knee joint, and it cannot walk; and since the verse says that it shall pass under the rod, and this animal cannot pass and walk, it is exempt. From here we extend this to all eighteen types of tereifos, all of which are exempt from tithing.
Yotzei dofen - an animal born via Caesarean section.
Mechusar zeman - an animal that is not yet eight days old.
Yasom - an orphan, meaning an animal that never had a living mother.
The Mishnah explicitly explains the orphan: "Eizehu yasom? Kol shemeisah imo o shenishchatah" - any animal whose mother died at the time of birth or was slaughtered at the time of birth, resulting in a situation where at the time the offspring is born there is no mother present at all, and therefore it is exempt from the animal tithe.
Rabbi Yehoshua disagrees and says: Even if its mother was slaughtered but the hide remains intact, meaning the mother's skin is intact - this is not an orphan. For there are places where it is customary, when the mother dies at the time of birth, to take her skin and cover the offspring with it in order to warm it; thus there is a way for the offspring to be under its mother even though the mother is not alive. Therefore, according to Rabbi Yehoshua, if the mother dies and the skin remains intact, the offspring is not considered an orphan.
In summary: The halachah does not follow Rabbi Yehoshua, and therefore an animal that has no mother from the moment it emerges into the world is exempt from the animal tithe. The general rule is: Everything enters the pen to be tithed, including blemished animals and including the eight disqualified categories - the rovea and nirba, muktzeh and ne'evad, esnan and mechir kelev, tumtum and androgynos - except for five that are derived from the verse in Parashas Emor: the kilayim, the tereifah, a yotzei dofen, a mechusar zeman, and the yasom.