The power supply is the hardware that powers the rest of the computer. It is usually found in the corner of the case while being visible from the outside so it can connect to the computer's power cable. It converts alternating current (AC) that your house is powered by, to direct current (DC). AC is not a consistent stream of current; it switches between a positive and negative current to allow it to flow back and forth through a wire. The power supply takes the AC and converts it into DC, which has less voltage and is stable.
The AC current goes through a filter and capacitor to first turn the current into a more stable version. The now DC is put through a power factor correction (PFC) which is trying to get the power factor (the ratio of the apparent power and active power) as close to 1 as possible. The current then goes through a process called "switching."
Switching has multiple components that include allowing power to flow through the rest of the power supply, protecting circuits, providing feedback to the computer, and creating high-frequency AC outputs.
The current then goes to a transformer that converts the voltage to a primary 12 Volt line and a secondary 5 Volt line. The 12V line goes through another filter and capacitor then is run through a DC-to-DC converter and regulated into a stable voltage to be output.
The most common DC currents used by a computer are 3.3 Volts, 5 Volts, and 12 Volts. The different amounts of voltage are used to power different parts of the computer; the 3.3 and 5 volt supply is used by digital circuits like the motherboard which powers CPU and the 12 volt supply is used by motors and fans.