Its mainly very simple, everything is event driven, normal for a micro-controller. Timers and external interrupts schedule high-priority actions, the rest will happen in the background using whatever processor cycles are spare.
The GCODE interpreter code wll be converting GCODE to a list of low-level instructions to the stepper-driver and
queuing them, the stepper driver is going to be interrupt driven and pull instructions from the queue as it needs them - all GCODE interpreters are like this I suspect, its the obvious way to go.
The complicated bit is figuring out when to accelerate and decelerate and corner-speeds and things like arc
“Seemingly instantaneously” means in under a few million instructions, not so hard!