If one sits in a doorway, but does not block it, and a second person sits next to the first, blocking it, [so that an animal is trapped inside]-the second one is liable [for a Shabbat violation.]
If the first sat and blocked the doorway, and the second came along and sat next to him, even if the first stands and walks away, he is liable and the second is clear [of liability.] What is this case like? Like one who locks his house to protect it, and a deer turns out to have been trapped inside.
Among the thirty-nine Torah-prohibited labors of Shabbat is trapping an animal. One violates this prohibition whether one captures the animal with one's hands and body, or with a net or corral. Here the Mishnah describes a case in which an animal has gone into a doorway and one blocks the door with one's body to keep the animal trapped. In such a case, one is accounted as having violated Shabbat—he has trapped the animal using his body. However, if one merely sat in the doorway to rest, partially blocking the animal's way out, one has not violated the prohibition. Only a second person, sitting and thereby fully blocking the door would be liable.
So far so good, but now intent enters into our Mishnah's calculus: if the first blocked the door, and the second was merely resting next to him, even though when the first goes, the second continues to block the door, he is nonetheless free of violation. As the Mishnah puts it, it is as if he locked the door to protect the house, without reference or thought given to the animal inside. He did not intend to trap the animal, he merely intended to rest in the doorway. Since the animal was already trapped inside, and he did not intend to keep it trapped, he has not violated Shabbat.