They communicate through pheromones. For example, an ant leaves a trail of pheromones (smell chemicals) when it walks out. It leaves a different trail if it returns with food. Other ants follow return trails back to the food, but do not follow the trail where no ant came back - bad news there!
Butterflies can smell pheromones and flutter their way to meet and mate from several miles away - such is the power of love!