Have you ever accidentally hit ⌘Q and quit an app when you really meant to press ⌘W to close a window? CommandQ stops apps from quitting unless you hold down ⌘Q for a short delay. This gives you time to catch your mistake and let go before the app quits.