PWM, without a diode and filtered, produces a voltage based on duty ratio. I mean PWM that pull up to source and pulls back down to ground, selecting between those two voltages, with a switch that conducts in both directions.
PWM switch-mode converter, through an inductor and with a free-wheeling diode into a capacitor, is a buck converter. Voltage out is based on duty ratio only for some loads; too light a load and voltage would rise to the source.
As Brad says, feedback is required (only for the case of too light a load).
In a Buck PWM converter, it can operate with current through inductor ramping up and down in sawtooth pattern, when voltage source is connected through FET switch to inductor and load, current in inductor rises. When FET switches off, current continues to flow through inductor to load but circuit is completed through diode to ground and current ramps down. Current never drops to zero. Large enough inductor smooths current, but is slow to respond to changes in load and output voltage dips if load increases. "Continuous conduction mode" (figure 4)
Too small a load (or inductance too low) and voltage would continue to rise above what duty ratio indicates. "Discontinuous conduction mode" (figure 5), current in inductor drops to zero while FET switch is off. Regulation by feedback involves either smaller duty ratio or skipping pulses of PWM.
Figure 6 shows output voltage depending on duty ratio and load:
en.wikipedia.org
The math gets pretty hairy. College level stuff.
Then there are switching losses, EMI, etc.
Designed correctly, SMPS are efficient and reliable. Not all are, and like everything we design into our systems, its characteristics have to be considered.