Thanks for the info! You know far, far more about how this works than I do, which is next to nothing, but it does APPEAR to me to be random. The reason I say this is because when I am force closing apps, I am generally force closing the same apps that I regularly use, that take approximately the same amount of time to force close, plus or minus a few in either category, but different apps seem to survive the force close each time. Based on my understanding of what you are saying, I would expect the same apps that are restarting themselves within the specific time period to always be the apps that survive the first force stop?There's nothing random, however it may look that way because of how Android OS stop and restart apps.
Force-stop is supposed to prevent an app from restarting until user opens its UI.
When you force-stop an app, the OS first removes any app's schedule, timer, alarms, etc. and then tells the app it is being stopped. An app based on that information can schedule a restart of its services using a specific delay, be it in milliseconds, seconds or even minutes.
For example, in my apps, required background services are auto-restarted after 1 or 5 seconds. So if you force-stop the toolbox twice within less than 1 or 5 seconds, it will not restart at all, because the auto-restart schedule is canceled and the app is not informed it is being stopped the second time (it's not yet running).
Concerning process count, it will not necessarily match the UI because the background service is not reloading exclusion "often enough". If you stop the background process, it will auto-restart (as explained above) and reload exclusion and will report up-to-date process count.
This issue is particularly visible after a fresh install. However it resolves itself when app/background process is restarted, including after an app update.
In next update, the list will be reloaded more appropriately which should solve this. Thanks for bringing that up.
EDIT: Devices running magisk may have processes named <package>:zygote64 which may be accounted for by mistake. I'll try to resolve that in next update too.
EDIT2: On more recent Android versions, process may be named <package>:usap64 Taken care of in next update too.
On a somewhat related note, I was quite shocked when I discovered that most, if not all, apps that claim to freeze apps are just force closing them, which the system then sees as being frozen. This is why you have to be careful which apps you force close, because then you can end up wondering why they aren't running themselves. It can be a good method of preventing apps you don't use often from running themselves, however (outside of running themselves at startup, I believe, if they are set for that).