There are a lot of bad CEOs, though. It's a lot like a politician -- it's quite difficult to become a CEO, and the skills to make it to that position don't always intersect nicely with the skills necessary to actually do the job well.
With that said, I've been programming for 25 years and I've only been a CEO for 3, so take what I said with a pinch of salt.
I do think people overestimate titles like this a lot, though, and it really comes down to what the company actually does and what is demanding for that company at that position/role. The CTO of a some-bullshit-as-a-service company may as well be straight out of college, because they're likely doing something trivial that literally anyone (including LLMs) could put together. The CTO of a well-used and reliable streaming service that handles a meaningful part of the world's Internet traffic is obviously solving a more interesting and demanding problem, and their decisions are going to be more important.