On its way to that voltage, if the voltage exceeds the voltage rating of the capacitor, the capacitor will eventually fail. At that point it will be permanently damaged. It may have even externally ruptured. Is there a max voltage drop across a capacitor? Or does it always charge up to the same voltage as the supply?
Voltage ratings on capacitors give the lowest voltage that may destroy the capacitor. This means that the capacitor is permanently destroyed as a capacitor, even if the voltage is removed. It may test as a short circuit, or it may break down at a lower voltage next time the capacitor is used.
Overvoltage refers to the application of a voltage that exceeds the rated voltage of a capacitor. This can occur due to voltage transients, power surges, improper circuit design, or component failure. When a capacitor is exposed to overvoltage, several adverse effects can occur.
Aluminum electrolytic capacitors can generally withstand extreme overvoltage transients of limited energy. Application of overvoltage more than about 50 V beyond the capacitor’s surge voltage rating causes high leakage current and a constant-voltage operating mode quite like the reverse conduction of a zener diode.
Or was; it probably won't be a very useful capacitor afterward. The cap will try to charge to the supply voltage. On its way to that voltage, if the voltage exceeds the voltage rating of the capacitor, the capacitor will eventually fail. At that point it will be permanently damaged. It may have even externally ruptured.
This means that the capacitor is permanently destroyed as a capacitor, even if the voltage is removed. It may test as a short circuit, or it may break down at a lower voltage next time the capacitor is used. Air spaced capacitors are usually not destroyed by high voltage but will arc over if the voltage is high enough.