What doing commands PWM_OUT and OUTPUT_MODE?

Hello everybody!
What happens when in airframe file set command PWM_OUT or OUTPUT_MODE?
How the firmware connects MAIN outputs to MAIN pwm when we write “set PWM_OUT 1234”?
How the firmware connects MAIN outputs to uavcan esc when we write “set OUTPUT_MODE uavcan_esc”?
What operations does the firmware do? Where this patch is described?
Thanks!