You aren't wrong, but if you use Cloudflare Pages with a static site the only job you have to do for a static site is make sure your Cloudflare account is secure with 2fa etc. Cloudflare will handle the security of everything else.
If you have Wordpress exposed to the internet, there's a lot more security stuff to deal with.
You're not wrong, but compromising a server that exposes nginx configured for static files, sshd, and nothing else is at least an order of mag or two harder. Probably no one is going to drop an nginx 0day on your blog.
The web server can be hacked so it serves something other than the static HTML you uploaded but there is no 'app' to hack, there's a whole class of problems that can happen on WordPress that can not happen with static sites.
I had a website got hacked when the FTP server running on the shared host got exploited. They added some malware injection code to the index.html file.
After that I added a cron job that compared the hash of the index.html with a precomputed value. Didn't change often enough to be a hassle.
Other siblings have piled on this, but let me just add:
Your source of truth for a static site will never be the deployed contents of the server (even if you do go that route). It will be your local Git repo or possibly your upstream Git forge.
Even in the rare case that such a simple case gets you hacked, you can throw away your entire setup and start over quite easily. Whereas all of the Wordpress/Drupal/etc/etc. options I'm aware of will require you to do your own database backups, if you are self-hosting, or else you are simply hosed (as the attacker could corrupt or erase the source of truth).
If you are with a hosted solution then obviously your security (and backups) will be as good as their security/backups, and all of this will be moot except for pricing.
I understand all this. I didn’t say that static sites are easy to hack or valuable, I responded to GP’s claim “They cannot be hacked”
I think static sites are a good technique that has vastly improved security over dynamic sites, but thinking that using them makes you invincible is faulty.
And the files can certainly be edited as they aren’t immutable.
They are less resource intensive and easier to maintain, but aren’t immune.
(Running mostly static sites converted from Wordpress sites, but also running 10 year old+ word press sites that haven’t been changed in forever)