Bava Kamma, Chapter 6, Mishnah 3. Our Mishnah deals with the law of "hamegadish besoch sedeh chaveiro" - a person who piles up a stack of grain in his fellow's field.
Stacking Without Permission:
If a person sets up his stack in his fellow's field "shelo birshus" - without obtaining permission, it is forbidden. Therefore, "va'achaltan behemto shel ba'al hasadeh" - if the field owner's animal ate the grain, the animal's owner is exempt, since he can claim: What is your grain doing in my courtyard?
Seemingly, there is no novelty in this law, since we have already covered all of this earlier, and the Gemara indeed asks this question. However, there is an additional novelty here: Even if there is no fence marking the boundary line, and animals are likely to cross it, this does not make it permissible. A person has no permission to be there, and once he crosses the line and places his belongings in his fellow's property, he thereby waives his rights regarding any damage caused to them.
Not only that, but "ve'im huzkah bahen - ba'al hagadish chayav" - if the neighbor's animal is injured by the stack, for example, if it sprained its leg, the one who placed the stack is liable for the damage caused to his fellow's animal, since it is as if he placed a pit there.
A Stack of Wheat:
The Gemara notes in passing: If the stack was made of wheat, this is not a food fit to be eaten by animals, and the animal was supposedly expected to know that it is not intended for it. Therefore, if it acted against its own good, ate food that is not suitable for it and was injured - for example, if it suffered a stomachache - this is not the fault of the stack's owner, since the animal was supposed to know that it is not good for it, and it is considered an unavoidable accident.
Stacking With Permission:
The Mishnah continues: "ve'im higdish birshus - ba'al hasadeh chayav" - if the stacker obtained permission from the neighbor to set up his stack in his field, and damage occurred to the stack, for example, if the field owner's animal ate the grain that was stacked there - the animal's owner is liable to pay compensation.
Seemingly, we return here to that well-known discussion: When one grants permission to his fellow to use his courtyard, does this mean he also accepted responsibility to guard his belongings? They disagreed on this matter, and we said that the halachah follows Rabbi, who holds that one who permits his fellow to use his property does not intend to accept responsibility. Our Mishnah, however, appears to follow the second opinion, that the person does indeed accept responsibility.
In conclusion, the Gemara says that the halachah follows Rabbi, that generally, one who permits his fellow to use his property does not accept responsibility. However, the case in our Mishnah is somewhat of an intermediate case: for if one says to all the people of the area, "You may all stack in my courtyard," whatever the reason may be. Since he said this to everyone, it is understood that even Rabbi concedes in such a scenario, that one who gives everyone permission to use his courtyard intends to accept responsibility, and this is the meaning of his words. This is therefore the case of our Mishnah, and for this reason even Rabbi would say that he is liable if he did not take care to guard the stacks, from the moment he told everyone to stack in his courtyard.
In summary: In this Mishnah we learned that if one stacks in his fellow's field without permission - the owner of an animal that ate the stack is exempt, whereas if the animal was injured by the stack, the owner of the stack is liable, since he is like one who places a pit; and regarding a stack of wheat, which is not a food fit for an animal, it is an unavoidable accident and he is exempt. If one stacks with permission - the field owner is liable, and even Rabbi concedes this in a case where he permitted everyone to stack in his courtyard, since then his intention is to accept responsibility.