A threshold serves two domains: When the entrance is open, the threshold is subsumed within the house and it is considered to be a private domain like the inside of the house. And when the entrance is locked, the threshold is not subsumed within the house, and it is considered to be a public domain like the outside.
Several explanations are offered to clarify this case. For example,
R Yehuda said that Rav said: Here we are dealing with the threshold of an alleyway open to the public domain on only one side. Although, by Torah law, it is considered a private domain, the Sages required him to establish a fourth symbolic partition on the side open to the public domain. This alleyway was covered, and this covering extended to part of the threshold in a manner that half of it is covered and half of it is not covered, and the covering is over the part of the threshold toward the inside. In that case, if the entrance is open, its legal status is like that of the inside, as it is considered as if there were a partition extending from the edge of the roofing above to below, based on the halakhic principle: Lower the partition. The opening of the alleyway is thereby sealed, rendering it a private domain. However, when the entrance is locked, it is no longer possible to consider the covering as a partition, and therefore the part of the threshold that is beyond the locked door of the alleyway is considered like the outside, i.e., like a public domain.
The halakhot of and many other halakhot are dependent upon the existence of partitions. A solid, high partition that seals a certain opening is a definite boundary.
However, in reality, boundaries of that kind are not present in every case. Thus, the question arises: What constitutes a full-fledged boundary and what constitutes a symbolic boundary? The determining principles in this matter are complex, detailed halakhot transmitted to Moses from Sinai. The principle of lavud establishes that a space less than three handbreadths wide is considered sealed. The principle of gode, which means extend, states that certain boundaries are considered to be extended and lowered or extended and raised.
Another principle that applies here is: The edge of the roof descends and seals, which states that the outer edge of the roof over a house or an alleyway is considered as if it descends and creates a partition that reaches the ground. However, the principle is relevant only when the roof has an edge of some sort, and when its area is more than four by four handbreadths.