Ant heads , especially the eyes and mandibles, come in all shapes and sizes. Ants use their heads to sense information about the world around them. This is very important for their survival and the life of the colony. If you watch an ant’s head, the antennae are always moving back and forth, touching, tasting, and smelling everything within reach.
Reference:
https://askabiologist.asu.edu/explore/ant-anatomy