On most Windows systems, Ctrl+Z triggers the “Undo” command built into an application. When you perform an action—like typing text, deleting a file, or moving an object—the software records that action in a temporary memory structure often called an “undo stack.”
Each time you press Ctrl+Z, the application reverses the most recent action stored in that stack. If you press it repeatedly, it continues stepping backward through previous actions in reverse order. This works because many modern programs are designed with state tracking systems that monitor user actions in sequence.
For example, if you type a sentence, delete a word, and then bold a heading, pressing Ctrl+Z once will remove the bold formatting. Press it again, and the deleted word may reappear. Press it a third time, and the typed sentence may begin disappearing.
However, Ctrl+Z only works within the context of the active application. It cannot undo system-level changes outside that program. Also, once you close an application, the undo history is typically cleared.
In short, Ctrl+Z works by storing recent changes in memory and reversing them step by step—making it one of the most essential productivity shortcuts in Windows.