Well, what's an inductor?
The law of inductance is:
V = L * dI/dt
So, you apply a voltage across an inductor, and the current ramps up (dI/dt is a change in current over time).
Say you apply a voltage for a brief moment, then turn it off and wait. The inductor starts at zero, charges up to some dI = V * dt / L, then discharges through the diode. (If the output voltage is also about zero, then the inductor discharges into the diode, with a forward drop Vf ~ 0.7V say.)
That current flows into the filter cap, which has a similar law:
I = C * dV/dt
If we've applied an average (dI/2) to the capacitor in this time, then its voltage will have changed by the amount dV = I * dt / C.
Applying a little bit of calculus, we can get more precise. The ripple voltage waveform on the capacitor will be a parabolic section, because it's the second integral of the input, which is a switched square waveform. The integral of a square is a triangle wave, and the integral of a triangle is a parabolic section (and so on to higher order curves). So rather than applying a constant current and getting a ramped output, we will see the ripple curving upwards, but changing by the same total amount. Nothing tricky about that.
When the switch turns off, inductor current ramps down, and the capacitor stops charging (again, along a downward curved parabolic section). When the inductor is finished discharging, capacitor voltage either sits still (no load current), or drops at a rate proportional to the load current. If the load is resistive, the current depends on voltage drop, and the voltage discharges along a decaying exponential curve.
The waveform marches on in this way, every time it repeats. If the switch turns on while the inductor is still discharging, then the output ripple doesn't see a decaying exponential section, the inductor ripple current dominates instead.
What does this do for output voltage?
If the inductor is fully discharged between pulses, then inductor current is discontinuous mode (DCM). We can use an energy argument here: E = V*I*t, but in particular, the integral of V*I (power) with respect to time. When the switch is on and the filter capacitor is relatively large, the applied voltage on the inductor is constant, while the current is a linear ramp. The area under the curve V*I is therefore the area of the triangle: (Vin - Vout) * Ipk * t_on / 2. Which is also the inductor energy E = L * I^2 / 2 (homework: show that this is the case). The output power is the average energy, E * F_sw (F_sw = repeat rate of the switch). V and I are then given by Pout and R_L.
In CCM (continuous current mode), the output voltage is simply the average of the switch voltage waveform, but be careful that we're not simply averaging PWM. I mean, that happens, but it shouldn't be your focus. We are charging and discharging an inductor. The inductor is key, and we must always control its current first and foremost. If we drive PWM directly, we're doing what's called voltage mode control, and it's very easy to blow up the switch (which has a hard current limit -- you aren't going to protect a MOSFET with a fuse!). With current mode control (average current mode control is easiest for CCM, peak current mode for DCM), you can
guarantee the switch will never blow up, and as a side effect, the input and output currents are limited, too!
Tim