Input Capacitance in LM 2596 Step Down voltage regulator
According to datasheet section 9.1.1 about input capacitor, it prevents large voltage transients at the input, and provides instantaneous current for the switching.