This generally happens when the device you plug in, asks for more current than is readily available, eg 250mA may be available, it may ask for 500mA, resulting in the computer trying to fix it by quickly increasing it, causing a surge.
The internal connectors that connect to the motherboard may be loose, faulty or (somehow) a connector may have come off.