Bechorot 2 - The Laws of a Firstborn Donkey
Since the Jewish firstborn did not die in Egypt, they are given a special status. A firstborn donkey has to be redeemed with a sheep or a goat, which is then given to a kohen. A firstborn kosher animal, if it is a male, has to be given to a kohen, who then brings it as a sacrifice. A firstborn human male is redeemed by giving money to a kohen. Today the law of a firstborn still applies, but in the absence of a Temple, animals are made exempt from this law by joint ownership of the mother animal with a non-Jew.
The teacher will first discuss the exemptions from the law of the firstborn, and in these he will start with the donkey, because its laws are simpler.
If one buys a fetus of an idolater’s donkey, or he sells his donkey’s fetus, even though he is not allowed to do this, the fetus is exempt from the law of the firstborn. The same is true for various kinds of joint ownership, because the Torah said "all firstborn in Israel," - but not owned jointly with a non-Jew.
Art: Eduard Karl Gustav Lebrecht Pistorius - The Donkey Seller