NULL means that the task has not been created yet or has been deleted. WAIT means it is waiting for an event. RUN means it is actually running. In a single-processor system, only one task at a time can be in the RUN state. Most of the time, this task will be the highest-priority task that is ready to run.
Individual ants run into other ants going the opposite direction.
They get turned around, and go off in the wrong direction. Other ants go off in circles. Yet, somehow, the job of bringing food home to the nest gets done. Like an ant, a task steadfastly pursues its own little mission. As with an ant colony, the mechanism for overall system control is not obvious to an observer.