How does a filtering capacitor smoth a changing current?
This is the case of a power supply with AC input and bridge rectifier with a smoothing capacitor. 

First thing to note is that the output is a load which is trying to draw DC current all of the time. However the input is a rectified sine wave and so the diodes only conduct when the input sine wave voltage is actually larger than the output voltage.

The current which is flowing into the load when the input voltage is less than the output voltage (when the diodes do not conduct) and when the input voltage actually falls to zero is all current coming out of the capacitor.

The input wave charges up the capacitor very quickly whenever the input volage is larger than the output voltage. This may only be for a brief moment, but it might be a lot of current. Then when the input voltage starts to go to zero, the diodes stop conducting and it is all down to the capacitor to supply the current for the load like a battery. Think of it as regularly charging a battery, but at the same time your load is always discharging the battery.

If the output load is too high then the voltage will fall a lot in between cycles of the AC. The up and down change of the voltage at the output of the power supply for a particular load is called the ripple voltage. Generally you select a capacitor for the load that you expect so that this ripple voltage is not too much. A bigger capacitor will hold more charge and result in less ripple.

If you remove the capacitor then the voltage will be just a full wave rectified sine wave and will fall to zero each half cycle. (Gray trace in your diagram.) It will not be a constant DC value at all.