Motion controllers are pretty impressive these days. PWM generation is too time critical to leave to high level processors, usually this is done in hardware if you want it to be guaranteed glitch free but there are also 'bit banging' servo controllers out there.