Why should care be taken while closing a capacitive circuit?

In theory when an empty capacitor is connected to a ideal voltage source, infinite current flows until capacitor is charged to the supplied voltage. Basically same thing when disconnecting a powered inductor, in theory the voltage goes to infinity. Many devices like computer power supplies, LED lamps and phone chargers have inrush current limiting because of capacitance.


edit /correction. ...

A step voltage cause a step current max Ic (t)=Vcc/ESR.
(@ t=0) when contact is made from discharged cap to an ideal voltage source then ....

Current decays at a slope by ~60% of initial surge max Ic at t=0 when t = ESR*C =\$\tau\$

So consider an expensive big cap with Vcc =12V, and ultra low ESR was 12 milliohm that in theory Ic max= Vcc/ESR=12V/12mohm = 1000 Amps

This is what happens If Vcc is a car battery is used as a capacitor of a value of many tens of thousands of Farads when the cold or CCA rating is only say 800 A.

But the same peak current occurs to a big plastic cap known to have low ESR but lower capacitance say with the same ESR. But when ESR is not given they rate the RMS ripple current or else it is called a general purpose meaning ESR*C is generally >> 100 us .

That might be an extreme example but illustrates the math .. otherwise the source Vcc would drop as C & Vcc charge up.

Computer grade caps or high voltage plastic caps conduct dangerous currents like boosting batteries with jumper cable. Reverse polarity charges can cause rapid breakdown and explosive results.