I'm being a bit vague here because where it is now is the result of decades of arms race between the cheaters and the developers, thus extremely complicated.
It's a program that sits on your machine, and watches both the game in question, as well as other programs, to make sure there's no funny business regarding the game.
It's somewhat effective, though it comes at a cost. There is a noticeable performance cost on modern anticheat programs, meaning you're losing performance for sometimes no tangible benefit.
Kernal level anti cheat programs are especially invasive, as they have deeper access to your operating system than would normally be allowed by any other program. This can be fine when used correctly, but if abused could be a massive privacy concern, or even a danger to your system. If you remember a little while back where every business windows computer went down for a day due to the crowdstrike antivirus, that's a potential result of kernal level software going bad.
So somewhat necessary evil, and they do kind of work. I personally don't love solutions that eat performance like this, and privacy is a concern of mine, but also I kinda get it.
They definitely can add anticheat to cooperative games, though again it feels a bit much.
I would say not to worry too much? The potential for abuse exists, but is not actually used. The companies that make the anti cheat software these days have way too much on the line to risk that kind of behaviour. It's one of those things that it's in a bit of a weird state, and some people like to keep an eye on it, but for the vast majority of cases is a minor inconvenience.