An action function is a piece of code related to a specific state; we can say that it is the state behavior.
Intuitively, if the application moves to this specific state the related piece of code is executed.