Since Catalina the OS itself is in a read-only volume and everything else is separate - by default, respectively "Macintosh HD" and "Data" as exposed in Disk Utility. Strictly speaking, I think programs cannot change the OS or boot sector. The only thing I know of that can is a macOS upgrade itself, and it does automatically take a pre-upgrade snapshot for the ability to restore.
Sure, but suppose I run something that spews all over, say, my homebrew install. That's not "part of the OS", but it might as well be.
Can apfs snapshots roll that back? Probably? But that functionality isn't exposed to mere mortals (and certainly not on the startup volume).
If there's a way to do this:
1. make-some-kind-of-snapshot abc123
2. make some changes all over the place (I don't know where!) that i then want to revert
3. restore-to abc123
and at this point, the entire system is exactly, precisely, bit for bit how it was after step 1 -- and where step 3 takes just a few seconds -- well, I'd love to know about it.
Time Machine can do that. Whether they're automatic or manual backups, you can boot your system in recovery mode and restore from a backup to fully revert to a previous snapshot. It will require a reboot and the speed of execution will depend on the size of the changeset from the current state.