This may be a dumb/begginer question, but I'm having trouble to understand what exactly happens when we connect a real capacitor directly with a battery.
In my understanding, theoretically, when an uncharged capacitor is connected directly to a battery of, let's say, 9 volts, instantly the capacitor will be charged and its voltage will also become 9V. This will happen because there is no resistance between the capacitor and the battery, so the variation of current by time will be infinite. Obviously, this is true when talking about ideal components and non-realistic circuits.
I thought that doing it in real life would cause sparks, damaged components, explosions, or whatever. However, I saw some videos and people usually do connect batteries directly with capacitors. Also, the current that flows from the battery to the capacitor is somehow of low magnitude, since it takes some considerable time to make the capacitor have the same voltage as the battery.
I would like to know why this happens, thanks.
This is an example of the circuit I talked about: