You can think of any software (or hardware) as a state that transitions to a new state when an event happens.
State0 -event0-> State1 -event1-> State2 etc.
In other words, it's all a state machine.