The main role of the CNC controller is to "convert" G Code to motor commands. This is a highly complex function and many books have been written about this.
As a top level overview, the G-Code is first interpreted, by the Interpreter. This converts to textual form of the G-Code to an in-memory representations. At this point separating motion related commands to any other commands is done.
All motion related commands are processed in a motion buffer (used for the lookahead functionality). The lookahead is especially important for smooth trajectories. The geometrical path is created (corners are sightly rounded, tool radii are added/subtracted). After the path is geometrically created the trajectory (velocity, acceleration, jerk) components are added, based on the target speed set in the G-Code and the dynamical capabilities of the machine.
After the trajectory is created it is sent set as reference for the motor controller. Here the calculated values might be interpolated if needed.