Both games use P2P mesh networking, so every player connects directly to every other player. Your IP is exposed to the entire lobby, and anyone can manipulate their connection to gain a combat advantage. Rockstar has never added anti-cheat to console.
Killswitch sits on a Mac bridging your router and console, monitoring packet timing on the primary game port (UDP 6672). All game traffic is encrypted, so detection relies entirely on metadata and timing gaps between packets. When an IP's gap score crosses a threshold, it gets blocked via the macOS PF firewall. Blocking doesn't kick them from the session. The mesh relays their game state through other players, but it adds enough latency to neutralize most of the advantage. You're essentially lag switching them back.
The README and NOTES file have more details.