We eat when we’re hungry, but social insects have to make decisions which will support the colony not just themselves. They typically divide labour as well as reproductive duties. Even in ant species such as Lasius niger where workers are not split into different physical ‘castes’, some workers stay in the nest while others leave to forage. It is often the younger ants who care for the nest while older ants leave to collect food.
Information that individuals could use to decide whether to forage includes their own experience of performing tasks, or their own physiology such as fat reserves. This was investigated in a recent paper published in the Journal for Experimental Biology.