As we have learned, two people who share a courtyard and decided to divide it can force each other to build a wall to separate the two sides of the courtyard. The Gemara explains that the need for the wall stems from hezek re’iyah – damage done by looking – i.e. a concern with privacy.
Our Gemara discusses a case where the two courtyards are one above the other, i.e. one is built on land that is higher than his neighbor’s. We find that Rav Huna rules that each one is required to build a wall that is a minimum of four amot high next to his own property – one above the other. Rav Hisda rules that the owner of the upper courtyard must participate in the costs of the owner of the lower courtyard.
Most of the commentaries agree that the issue here is that of hezek re’iyah, and therefore they explain that the upper courtyard was less than four amot above the lower one, which leaves a situation where either party might look in at his neighbor, obligating both of them to build appropriate walls. The Ge’onim go so far as to rule that if the upper courtyard is more than four amot above the lower one, the owner of the lower courtyard does not have to participate in building the wall, since he cannot look into his neighbor’s yard. The Ramah rejects this interpretation of the Gemara, arguing that even if the lower courtyard is more than four amot lower than the upper one, the owner of the lower courtyard must still participate by building his section of the wall, since he, too, derives benefit from the wall, either because he can use it or else because it keeps things from falling from his neighbor’s yard into his own.