Click flag. Ants leave nest. When ants find food (green) they eat some and leave a pheromone (red) for some time as they head back to the nest. If ant detects phereome, it turns very little. If an ant doesn't detect phereomone, it is likely to turn at a wider angle.
This is very crudely based on the idea that ants leave pheremone to lead other ants in the right direction. Ants only leave pheremone for a limited time after eating. Some pheremone eventually wears out as ants travel over it. See also ants following a line of pheremone: https://scratch.mit.edu/projects/520597948/