Avodah Zarah, Chapter 5, Mishnah 10. In the two previous mishnayos we learned that yayin nesech (wine used for idolatrous libation) that became mixed with kosher wine renders the mixture forbidden, both in a case of dry with dry, where we are dealing with separate barrels, and in a case of wet with wet, where the wine was poured into a vessel containing kosher wine. Our mishnah presents the opinion of Rabban Shimon ben Gamliel.
The opinion of Rabban Shimon ben Gamliel:
True, the mixture is forbidden to derive benefit from, but this does not amount to a total financial loss. In his view the owner may deduct the value of the forbidden component, from which he may not derive any financial benefit, and the rest of the mixture, which is still his, he is permitted to sell to a non-Jew.
For example: the price of wine is ten dollars a liter, and a person has ninety-nine liters of kosher wine into which one liter of yayin nesech fell. The same applies to ninety-nine barrels of kosher wine into which one barrel of yayin nesech became mixed. Altogether that is one hundred liters (or one hundred barrels) at ten dollars per unit, one thousand dollars, of which one hundredth is forbidden to benefit from.
Rabban Shimon ben Gamliel's position is that there is no problem here: he finds a non-Jew and sells him all one hundred barrels, or all one hundred liters, but charges him only for ninety-nine. In this way he derives no financial benefit at all from the yayin nesech that became mixed in.
The opinion of the Tanna Kamma:
The Tanna Kamma does not hold this way. Once a mixture has been created, all of it takes on the status of a forbidden substance, and there is no permit even to sell the mixture to a non-Jew at a reduced price.
The words of the mishnah:
"Yayin nesech shenafal al bor" - yayin nesech that fell into a pit of wine. The example the mishnah chose is wet with wet, where the liquids themselves mix together, but as stated, the law is the same with barrels as well.
"Kulo assur b'hana'ah" - all of it is forbidden to derive benefit from. The entire mixture is forbidden to benefit from, and this is the position of the Tanna Kamma.
"Rabban Shimon ben Gamliel omer: yimacher kulo l'oved kochavim, chutz midmei yayin nesech shebo" - Rabban Shimon ben Gamliel says: let him sell all of it to a non-Jew, except for the value of the yayin nesech in it. Even though the component that got mixed in is forbidden, the mixture as a whole does not itself become forbidden. Therefore he sells all of it to a non-Jew, deducts the value of the yayin nesech in it, and sells the rest at the regular price.
The halachah was ruled like Rabban Shimon ben Gamliel, the last opinion in the mishnah. This ruling applies both to wet with wet, as described in our mishnah, and to dry with dry, as in the previous mishnah. Rabban Shimon ben Gamliel would say the same in all the cases taught in the previous mishnah as well, such as meat and milk and the like: the principle is that one may not derive benefit from the component that became mixed in, but the rest may be sold to a non-Jew, and this is the accepted position in halachah.
In summary: in this mishnah the Tanna Kamma and Rabban Shimon ben Gamliel disagree about a mixture that is forbidden to derive benefit from. According to the Tanna Kamma the entire mixture becomes forbidden and may not be sold at all, while according to Rabban Shimon ben Gamliel he sells all of it to a non-Jew while deducting the value of the forbidden substance in it. The halachah follows Rabban Shimon ben Gamliel, both in wet with wet and in dry with dry, including the other prohibitions listed in the previous mishnah.