Eusocial insects have developed from their organization an ability to recognize one another within their society. This recognition of others, from recognizing individuals to groups, is an indication of society, and creates an identity colony wide for each insect.

Individuality thesis 

Ghiselin (1969, 1974) and David Hull (1976, 1978) asserted that complex or high level social insects are individuals rather than being like organisms. This claim originally related to the issues regards the nature and reality of species, but can be interpreted to relate to inter colonial developments. Within the colonies of social insects such as ants, dynamic social recognition systems make their advanced societies possible. The mediator for the social recognition systems included a blend of hydrocarbons that each individual within a colony carried as a way to recognize others from within the same colony. The individuality of the sole insect and the cohesion of the colony are very similar in the ways that they approach recognition and solve conflicts.

In the eusocial wasp Metapolybia cingulata, every individual fulfils a specific role in the colony in terms of nest building and for this reason the colony is able to thrive and actually have a nest.  The roles have been categorized as: specialized water foragers, specialized pulp foragers, active builders, active generalists, and idle workers.  If even one of these roles, even the "idle workers", did not accomplish their goal, the colony as a whole would be unsuccessful in maintaining a nest and would ultimately die.

Recognition through hydrocarbons 

Some species of ants have evolved to have the ability to recognize other individuals from their colony to avoid aggression when met. The mechanics of this recognition are mediated by a mixture of specific signatures emanating from the individual, this mixture is a blend of hydrocarbons that emanate from the individual through the insects cuticles. The mixture of hydrocarbons is specific to the insect’s colony and is called the insect’s label. Upon one insect’s interaction with other insects, the perceived label is compared with its internal colony odor, the “template”. If the perceived label doesn't match the ingrained template then the encountered individual will be rejected.
The process of recognition by the individual is split into three components: production, perception, and action. The production factor includes the making of the label; in ants and other social insects the label is a signature mixture of long-chain hydrocarbons (cuticular hydrocarbons, CHCs). The perception factor involves the specific individual detecting the label on the other's cuticle and comparing what they perceive to their own innate template. A template-label differential is what is perceived and if that differential exceeds a certain point the ants will turn to aggression and if not they will accept or ignore the other individual.

Conflicts 

Organisations built from individuals rather than cells face innate problems when it comes to reproduction. A collection of individuals that make up the colony result in a less-than-one relatedness which therefore causes conflict over the allocation of reproduction. The effects of these differences cost the whole colony as the colony must produce offspring that have genes suppressing the behaviors that allow conflict to arise.

References 

Sociobiology