Mac storage basics · System Data and the storage categories
Why does System Data go down after I restart my Mac?
Short answer: Restarting clears swap (virtual memory) files, the system's temporary folder and some rebuildable caches. It never touches your own files.
A restart clears things that only exist while the Mac is running: swap files used for virtual memory, the system's temporary folder, and some caches that apps rebuild on demand. If memory had been under pressure for days, swap alone can account for many gigabytes.
If a restart frees a lot of space every time, something is pushing memory hard or leaving temporary files behind — Activity Monitor's Memory tab will show which app. A restart doesn't touch your documents, photos or apps.
See what swap is.