Bava Basra, Chapter 2, Mishnah 10. The cases discussed in this Mishnah deal with a neighbor who causes damage to his fellow in an indirect and non-immediate manner: two adjacent fields are owned by different people, and an action performed in one of them is liable to ruin what is being done in the second.
The three cases in the Mishnah:
"Marchikin es hamisrah min hayarak" - A person who wishes to make a steeping pool to soak flax for the preparation of fabric will find that its waters become foul and smelly, and most importantly: the adjacent vegetables are ruined. Therefore, one may not position the steeping pool adjacent to his neighbor's vegetables.
"V'es hakerishin min habetzalim" - One must not grow leeks next to a neighbor's onions, because the leeks draw away the nutrients, and as a result, the onions lose their sharpness and are ruined.
"V'es hachardal min hadevorim" - One must not grow mustard plants next to a neighbor's beehives, because the bees will come and eat from the mustard, and the honey they produce will become sharp and be ruined.
What all these cases have in common is that the damage is not direct and is not immediate, but rather is caused in an indirect manner and over time.
The dispute between the Sages and Rabbi Yosi:
The approach of the Sages: The responsibility lies with the damager, and he must be considerate of his neighbor. If the neighbor has adjacent onions, he is not permitted to grow leeks.
The approach of Rabbi Yosi: The responsibility lies with the damaged party, and he must distance himself. Why should the damager be forced to take the initiative within his own private domain, when he is doing a completely normal act like growing leeks? If this is inconvenient for the neighbor, he should relocate his onions to another place. The damage is not caused to him directly, but rather is liable to develop over time, and it is in his hands to consider and decide whether to move his crops.
The halachah was decided in accordance with Rabbi Yosi, that the responsibility rests on the damaged party. Therefore, despite the wording of the Mishnah, a person is permitted to grow these things within his property even though it is not good for his neighbor's crops, and it is up to the neighbor to pay attention to this and decide as he wishes.
'Girei dilei' - The limit that Rabbi Yosi concedes:
This does not mean that Rabbi Yosi permits all damage. In some of the cases taught earlier - such as placing corrosive or hot materials next to a neighbor's wall, or keeping an open fire under a low ceiling - Rabbi Yosi concedes that this is forbidden. Even though the responsibility to be careful fundamentally rests on the damaged party, the damager is not permitted to perform actions that directly cause damage and pose a danger.
For example, a person may not take a bow and arrows in his courtyard and shoot in all directions, claiming: After all, I shot in my own courtyard, and I have the right to do as I please in it. This is clearly forbidden, since the arrow flies and strikes the neighbor in his courtyard. This is direct and immediate damage, or at the very least a direct risk imposed on the neighbor, and this is the definition called 'girei dilei' - as if his own arrows are being shot from his domain into his fellow's domain, and this is not merely a passive action.
What the exact definition of 'girei dilei' is - this is disputed by the Rishonim. However, the relevant point for us is that in our Mishnah, this is not the situation: there is no direct strike on the other person's property here, but rather the steeping of flax, the growing of leeks, or the growing of mustard. Therefore, according to the approach of Rabbi Yosi - which, as stated, is established as halachah - it is permitted to do these things.
Rabbi Yosi's claim regarding mustard, even according to the approach of the Sages:
Rabbi Yosi adds that even according to the view of the Sages, who maintain that the responsibility lies with the damager to ensure he does not damage his neighbor, in the case of mustard it is permitted: "Rabbi Yosi matir bechardal" - Rabbi Yosi permits mustard. The reason for this is that the bees damage the mustard just as much as the mustard damages the honey they produce. Since both damage each other to an equal degree, there is no reason for the damager to be in a worse position than the victim, and even according to the Sages, one should not prevent the planting of mustard near the hives.
In summary: The Mishnah deals with three cases of indirect damage between neighbors - a steeping pool from vegetables, leeks from onions, and mustard from bees. The Sages and Rabbi Yosi disagree over who bears the obligation to distance themselves: according to the Sages, it is the damager, and according to Rabbi Yosi, it is the victim. We noted that even Rabbi Yosi agrees that direct damage, known as 'girei dileih', is forbidden, and we explained his claim that in the case of mustard, it is permitted even according to the Sages because the damage is mutual. The halachah follows Rabbi Yosi: it is permitted to plant mustard near hives, as well as to place a flax-steeping pool near a neighbor's vegetables, and to plant leeks near his onions.