The voltage would be from the device that drives the spindle, most likely a plugin. All Mach does is drive a number (whatever S or screen controls say). The RPM of the spindle is what Mach is concerned with. It really doesn't care how that is driven. Could be a voltage, or air pressure, or hydraulic, etc...
In the case of a motor driven spindle, there may (or may not) be some gear ratio involved. This is defined on the spindles tab in the configurations dialog. Hence we have the notion of the commanded spindle RPM and the notion of the motor RPM that is required to produce the commanded spindle RPM. Ultimately, the motor RPM is what is needed to be controlled. Devices that control spindles (typically from a plugin) have access to all of this information and can use it as it needs to. Typically, it is a pretty simple calculation.
Whenever the commanded RPM is changed (by S word or screen/control panel), the plugin will receive a message telling it that the spindle has changed. The spindlespeed.mcs script is also called at this time. Anyway, the commanded RPM is given to both the spindlespeed.msc script and the plugin.
As an example, say the spindle motor is controlled by an analog voltage from 0 to 10v and that there are two spindle ranges defined. Range 1 is 0 to 2000 RPM and range 2 is 0 to 5000 RPM. To start with, say range 1 is selected and a spindle RPM of 1000 is commanded. The plugin would then get a spindle changed message with 1000 as the rpm parameter and do:
1. RPM 1000 is specified
2. Determine which range is selected (1)
2. Determine the maximum RPM of the selected range (2000)
In this case, an output voltage of 0v would be 0 RPM and an output of 10v would be 2000 RPM as defined by the spindle range 1.
3. Determine the linear ratio of volts to RPM (1000/2000 == .5)
4. Apply the ratio to the maximum voltage of 10 (10 * .5 == 5v)
5. Output 5v to the VFD.
Notice that step three applies a LINEAR ratio. And that handles 99% of the VFDs out there. But what if 5v doesn't actually run the spindle at 1000 RPM? Well, that is when you need to provide some sort of spindle RPM feedback. And then the plugin also needs to be able to apply that feedback. Not all plugins will operate the same. For instance, the Galil plugin offers two types of spindle control. 1) Spindle without feedback and 2) spindle with encoder feedback. If using the first method, it uses that linear scaling of voltage that I described above. Basically, you get whatever RPM 5v produced no matter what. If using the second method with feedback, the Galil plugin will offset the voltage by whatever amount if required to achieve the desired commanded RPM.
To summarize, and to answer your question directly, the plugin that controls the spindle "reads" RPM and range information from Mach and its' job is to make that happen.
Steve