How does a computer shutdown really work
Basically the when the operating system has closed down properly, it says to the motherboard approximately the same thing as pushing the front panel button long - the motherboard turns off the ATX power supply, the main part of it. Then everything that uses main supplies won't get power any more, i.e. PU, memory, storage. The motherboard still gets standby power from power supply, and that is why pushing the power button, or getting a wake-on-lan packet can trigger the motherboard to turn the main supplies back on.