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.