Actual security is barely relevant except to the extent that if it doesn't add any security, the NSA might get worried that people will stop using Cloudflare.
Fake security - number of blocked users, which Cloudflare calls "bots" regardless of whether they're people or bots - is used in Cloudflare marketing.
The checkbox is just a small part of what the checks are doing. It's monitoring everything the browser is doing and how the browser is responding to certain events up until you tick the checkbox, at which point it determines if you need one of those "are you human" challenges or if you can pass without interruption, based on how bot-like you are.
> Apparently this just simulates clicking on the checkmark
Not just that. It also spoofs a bunch of browser stuff.
A standard headless browser will probably get flagged.
I would think of headless browser automation in exactly the same way you would about cheating in FPS video games. The red team always has the initiative and can win if they want to spend enough time and money.