The CTO is the chief engineer he or she sets technical direction for the company. VP of Engineering is the top manager for that division and executes the CEO’s vision using technical choices made by the CTO.
In many companies these are the same person, but not always. In my last startup they were separate people. The best chief engineer (CTO) isn’t always a good people person (VP).
Software companies that differentiate by some metric other than core technology might not need a CTO, which would explain your confusion if that’s your background.
I worry that a lot of HN "CTO discourse" is really wishcasting, about what an "if I was monarch of all the developers" role would be (and then about what it's like to aspire to such a role). No healthy engineering team has such a person!
What industry are you in? In deep-tech / hardware the role of chief engineer is well understood. In biotech it is sometimes called chief scientist.
Since you asked: I'm one of the principals at Fly.io. Before that, I was one of the founders of Latacora, which embeds directly inside of startups for years at a time running their security teams full time. Before that, I founded Matasano Security. Before that, I was a Product Manager at Arbor Networks, after being the lead developer on their DOS product for a couple years. I'll stop there (I'm older than the median HN commenter).
Later
For what it's worth, for companies literally chartered to do scientific exploration --- drug discovery chemistry, for example --- I completely buy that there is a real "Chief Scientist" role, though I can't claim to understand that role well enough to defend it. But that doesn't describe any software company anywhere. Regardless, "CTO" is something different.