Operation of a Buck Converter
The basic answer to your misunderstanding is that the load and the input voltage are NOT connected directly when the switch is closed.  The inductor is between the two.

Voltage accross a inductor can change quickly, but current only changes proportional to the applied voltage.  In other words, the current will ramp up slowly.  The load only sees the current coming out of the inductor.  If the switch were to remain closed, that current would eventually build up too much voltage on the capacitor.  However, the switch is only closed for short periods and with a average duty cycle so that the average current coming thru the inductor is exactly what is needed to maintain the desired voltage on the output capacitor.