Helping people with computers... one answer at a time.
When Windows updates itself it's subject to many of the same rules other software is. One rule: you can't make changes to running software.
Why is a system restart required on installing any patches OR any specific software (E.g. Windows update)? Exactly What happens in the system during such restart?
Have you ever run into the "File In Use" problem? You know, the one where you can't delete a file because someone else is using it? Or perhaps you've encountered "device cannot be stopped right now" when trying to safely remove a USB device?
Windows runs into exactly the same problems.
Only worse, actually.
Windows update is, of course, about updating Windows itself - that much is clear.
There are two important things to realize about Windows:
It's huge. Patches or updates actually only strategically update portions of Windows. The portions that are updated vary from patch to patch depending on what parts of Windows are considered to need immediate updating. Updating all of Windows at once is the stuff of service packs or completely new releases.
It's just a computer program. Yes, it's a big, complex and important computer program, but it's a computer program nonetheless. In many ways a Windows computer program which means that it's subject to all of the rules of Windows computer programs that it, itself imposes.
The rule that second point imposes is very simple: you can't make changes to a computer program while it's running.
And some portions of Windows are always running.
The good news is that Windows is huge, and some portions - many portions perhaps - either aren't running or can be temporarily stopped so that they can be updated. When only these portions of Windows are updated, no reboot is required.
The other portions pose a problem.
The solution is a sequence that looks something like this (over simplifying somewhat, as usual) :
Windows update notices that a file it wants to update is in use, and cannot be updated.
The new version of the file is copied to a temporary location instead.
Instructions are added to the system which are to be executed on the next boot.
Windows Update informs you or annoys you with the message that a reboot is required - or if so configured just reboots the machine when it's done.
As early in the boot sequence as possible, before the affected programs have begun to run, the instructions left behind delete or move the old version of the file to be updated, and replace it with the new one from the temporary location.
The boot sequence then proceeds and the new version of the file is used.
The old version of the file may be preserved if the update can be reverted, otherwise it's simply deleted.
I'm sure you've also seen updates that happen as the machine is shutting down - the same concept applies: components are updated after they've shut down as Windows shuts down, and Windows elects to update them as it closes so that when it starts up again the new versions will be in place.
There's a lot of effort that's gone into reducing the number of reboots an update (or even an install) requires. Given the complexity of the software managing all the possible combinations and possible "in between" states is a pretty large undertaking. By and large reboots now happen only when they really need to.
Even if that still seems to be more often than we might want.