The analogy is correct. Restarting returns a device to a known state.
There might be a problem with the system configuration. Returning to a known state helps people figure this out.
Restarting the machine would turn off any programs that were started by accident. It also would recover from memory leaks or other problems that occurred with running programs.