One is not allowed to carry on Shabbat between a “public domain” and a “private domain”. However, the definition of these domains is counterintuitive. A private domain is defined be being enclosed by walls, even if used by many people. Even a whole city can be a private domain if it is enclosed by walls with a gate locked at night. (contrast this with the use of “public domain” in American law which refers to land owned by the collective of all citizens for common use.)
What this means is that there are many areas which are technically private domains, but experientially are seen as public domains, since, after all, they serve the public use. This leads to a big problem, if people carry in a shared space, they are liable to forget there is any prohibition of carrying altogether, carrying in the main street of a walled city doesn’t feel that different then carrying in the open spaces outside the city.
To solve this problem King Solomon created the law of Eruv. If there is a common area shared by many people, attached to areas dedicated for private use (such as a courtyard shared by many houses), one is not allowed to carry from the courtyard into the houses or vice versa without an Eruv.
But, what is an Eruv? (note: the wires around a city which are commonly called the Eruv are functioning as legal “walls”, and are the prerequisite for an eruv, which only applies to enclosed spaces, and not the eruv itself)
Hilchot Eruvin 1:6 “And what is this Eruv? It is to join together in a single food which is set aside before Shabbat, as if to say: “We are all joined together, and we all share in the same food, and none of us separates our property from others, rather just like we all equally partake of this common space, so too we all equally partake of the spaces that each of us has taken for ourselves (our private houses), and we are all one domain.” and through this act people won’t err and imagine that one is permitted to bring thing in and out between a private and public domain.”
An Eruv is a statement of communal sharing – we share in our bread and, by extension, our property. This is a completely different way of viewing our houses. In principle we are part of a community and all of the land is in the service of the common good, but for practical use we have delineated separate spaces for each of us to have privacy. This is a transformational way of viewing things, and is reinforced weekly when we each contribute a loaf of bread for the shared Shabbat food.
In order for the Eruv to serve its function its meaning must be clear to people. Even if there is a “partnership” at the street level (an alternate form of Eruv), which technically should satisfy the requirement of Eruv, Chazal demanded that each courtyard have its own eruv, so that even the kids shouldn’t forget the idea of the Eruv (halacha 19).
Nowadays we don’t have a weekly collection of bread from all of the members of the community for the Eruv, and instead rely on one person who transfers ownership of a loaf of bread to the community. This is legitimate (as explained in halacha 20), and practically necessary (imagine needing to gather a loaf of bread from each family in Jerusalem on a weekly basis).
But it comes with a loss – such an Eruv becomes a background fact of life. It no longer teaches the idea of community which Eruv represents. And we lose out on a big part of Shlomo’s educational goal of emphasizing the prohibition of carrying in the public domain (an area open to all of humanity) by recognizing the nature of our shared “private” domains.