The humble power brick exists mainly to keep mains voltage out of your gadgets
That bulky box halfway along a laptop cord is doing a safety job. It steps hazardous 120- or 240-volt household current down to something gentle before any of it reaches the device. Every electronic product needs some kind of power supply, whether hidden inside or dangling from the plug.
A power supply takes electricity from a source and reshapes it into the voltage, current and frequency a particular load needs, which is why engineers also call them power converters. The input might come from a wall socket, a battery, a fuel cell, a generator, solar panels or even another supply. Output leaves through one or more rails, normally by wire, though some designs beam energy wirelessly. Beyond conversion, a supply may cap current at a safe level, cut power during a fault, filter out electrical noise and surges, correct power factor, or store energy to ride through outages, as an uninterruptible supply does.
Designers sort them several ways. A regulated unit holds its output steady even as the load or input voltage shifts, whereas an unregulated one lets output drift. Adjustable models let users dial in voltage or current by knob or control signal. An isolated supply keeps its output electrically separate from its input rather than sharing a common connection.
Physical packaging matters too. Bench supplies sit on a desk for testing circuits. Open-frame supplies, with little or no case, are built into machinery, and rack-mount units slot into equipment cabinets. Some share a circuit board with the device they feed. External adapters, nicknamed power bricks, sit in the cord, and wall warts fold the whole thing into the plug; both are favoured in consumer electronics for safety.
Internally, the big split is linear versus switching. Linear designs process power directly with components working in their linear range, where energy is shed as heat. Switching designs chop the input into pulses or alternating current first, using transistors that spend most of their time fully on or fully off, so they waste less and are usually more efficient. Supplies turning AC into DC often leave a trace of leftover alternation called ripple; a supply converting one DC level to another is a DC-to-DC converter.
Source: Power supply