Some ants are assigned to guard and protect the colony from intruders like other invading ant species or other insects. Many ant species are also assigned to raid and take over rival ant colonies.
Many species of ants work together to build nests that are very complex and can run deep within the ground. What may seem like a very long and difficult task can be accomplished efficiently with a team of "worker" ants.
Some ants are assigned to take care of their colony and perform tasks like watching over the eggs produced by the queen ant and feeding younger ants (larvae).