What does "Reinstall macOS" do, exactly?

I was recently having some problems with iTunes, and decided to reinstall macOS Sierra. I held Command+R on startup and clicked on "Reinstall macOS" without erasing the hard drive in Disk Utility. Once the reinstall was complete, I started back up and all of my files and programs were still there, along with my settings, desktop wallpaper, and everything else. (The iTunes problems were fixed.)

What exactly does this "Reinstall" feature do, if it doesn't remove programs and change settings to default?


It does exactly what it says it does–reinstalls macOS itself. It only touches operating system files that are there in a default configuration, so any preference files, documents and applications that are either changed or not there in the default installer are simply left alone. No doubt it is a bit more complicated than that but all a re-install does is replace the old files with "fresh" versions.

No doubt there are preference files and other things that are deleted/modified but Apple seems to have gone to great lengths to ensure that reinstalling the operating system won't delete anything that you have subsequently installed/modified.