A switch mode power supply is a type of electronic circuit used to convert power. They are also known as switching-mode power supplies or SMPS for short. The typical topology of an SMPS is AC to DC conversion, although users may find other switches that feature an output of DC to DC voltage.
For the power supply to transform its input voltage into an output voltage, the switch will turn on and off with high frequency. The inductors or capacitors within the device will then regulate the power to the device. This continuous switching of the capacitor maintains the voltage at the desired level and provides excellent efficiency.
In the case of AC mains usage, the input voltage will be filtered the same way with a capacitor or inductor to regulate the power and give you the DC output.
The power supply unit you use in your PC is important as it ultimately determines what other components you can use within it and the output in performance you get at the end. For high-end gaming PC builds you should aim for an efficiency rating of >80%. The higher the rating, the less electricity it consumes. The less electricity used means easier heat dissipation which keeps the PC cool and performing optimally.
Switching power supply units with higher efficiency and lower levels of heat dissipation are typically compact in nature, making them ideal for projects with limited space.