No one seems to have addressed the issue of 'how does it work', which seems to be the theme of this thread?
Specific designs in PSUs are all different in detail, but similar in essence. The idea is to take -say- 240V AC and change it to -12, +5 and +12V DC with some efficiency as a byproduct. PCs use a technology called 'Switched Mode' -hence SMPSU- to produce these lower voltages. SM runs at a high frequency, so inductors are smaller and lighter than in an analogue PSU, and as the power semiconductor is only switching on and off, the heat dissipated is lower as well. That's the what. Now for the how.
Incoming AC is bridge-rectified and fed to the reservoir capacitor, producing about 380V DC. That's why you don't poke around inside one without knowing what you're doing. This DC is then chopped up by a power semiconductor and fed into the primary winding of a ferrite transformer. Other secondary windings pick off the required output voltages as AC which is then rectified, smoothed and output to the PC. One of these, usually the +5, is monitored by the circuitry controlling the power transistor so as to vary the power applied to get the +5.0 exactly. Depending upon the design, the other output voltages might have their own regulators, or just take their chances that if the PSU is loaded as the spec on the box, they will be correct. You get what you pay for.
There are two other small points: the power control circuit is often fed from the same transformer as the outputs, so it needs a kick to start the process. If the PSU has a fault or is shorted, the kick won't be enough to start the control circuit, so it protects the PSU. If the outputs are shorted in use, the excessive requirement is detected by another small circuit, and it will switch the supply off until the input power is cycled. Modern PSUs also include standby voltages, remote on switching and 3.3V rails - but these are all basically covered in the thumbnail description above.
BTW, if you do try to replace any internal parts, watch out for that 380V - it's very nasty, and ensure that any capacitors are low ESR types for SM PSUs. Have fun!