To answer the question in the title, they don't.
While ants in particular may be able to determine what anthill they belong to using pheromones, nothing says that other types of collectives would need to stay separate. You could imagine that a business is a sort of collective consciousness. The organizational structure defines how the business divides into departments, and how departments divides into teams. The CEO sets the direction and goals of the overall organization, whereas each team composing the business implements some functionality which moves the business towards the goal. You may ask the business a question: "Does SRS_BUSINES_LTD use fossil fuels in it's production process?" And the question will (usually) propagate through the company to the relevant parties who know the answer, whereupon the company will return the result back to you. How exactly this happens may vary from company to company. If it's a small company, you might ask the CEO, who will either tell you the answer right away, or ask his subordinates to find out, who will propagate the answer back up the hierarchy. A larger company may have a department specifically for addressing feedback. That department might be a call center, a group of people, etc. Some companies might ignore your question outright (Comcast?). But either way, if you look at the organization as a whole, you can treat it as a large information processing mechanism that can answer questions by delegating to it's constituent parts.
The thing is, nothing restricts a person from belonging to only one business. A person can work for one company in the daytime, and moonlight at night. 783
Even throughout the course of the day, a person may have several functions. During the morning meeting, they may coordinate discussion, but during the rest of they day, they may answer phone calls, do research, marketing, programming, or whatever their role entails. They may belong to different groups within the company (Company Volleyball Team etc), each with it's own process for answering questions. These groups don't even have to be "official", they can be ad-hoc groups that are just people who happened to be around together at a time. i.e. you walk up to the coffee machine and say, "Hey, does anyone know who took the stapler?" That group of people at the coffee machine might look at each other, and self organize to answer your question. "Well, I know <PERSON> had it before lunch". "Oh hey, <PERSON> gave it to <PERSON>! You should ask her." In this way, the ad-hoc collective group that just formed answered the question better than the individuals would have been able to.
People can even be part of different collective consciousnesses at the same time. Consider that most people are simultaneously part of a business, and a country. When a hiring manager decides to open a role, they may simultaneously perform the service for the business by expanding the company, and a service for the country by attracting foreign knowledge workers.
But what it comes down to is that the rules for individual collectives are different. Collectives can restrict entry to people who belong to other collectives. Or they can merge with other collectives. And, in certain circumstances, groups that belonged to one collective pass a referendum by majority vote to secede from a larger collective which causes their prime minister to resign. 434