What it does is check and repair system files(SFC), and the DISM portion fixes component store corruption, These 2 tutorials will explain a bit to give you a better Idea of what they do.
And fsutil resource at the beginning resets the resource manager.
The commands are chained together in the order they need to be don,e to work more efficiently, to clean and repair or replace system(Windows files), repair Windows Update, and repair and reset Windows Store.
You need to be connected to the internet when doing this, so Windows can connect to Microsoft's servers, to check and compare the files and download replacements if needed.
You need to reboot because files in use by the OS cannot be repaired.