Here comes another article to tell you how incredible ants are. Two days after an ant dies, it gives off an odor that lets the other ants know it is dead. The ants then pick it up and carry it to a graveyard.
Before that point, its corpse is ignored. The odor is oleic acid. Scientists dropped some on a living ant, and against its will it was carried to the graveyard. The interesting thing is that the ant was clearly alive but the others were ignoring its squirming and attempts to escape, showing that the smell overrides everything else.
To ants, if you smell dead, you are dead. But why do they do this? As you know, corpses are pretty ripe sources of bacteria, and ant colonies are very highly concentrated in population.
That means it’s important for them to designate a graveyard and carry the dead there to avoid the bacteria spreading.