Very much depends on the company but here’s what I think helps, perhaps in this order...
1. Be really good at Powerpoint
2. Be really good at explaining technology to non-technical people
3. Conversely be really good at understanding the business domain you work in
4a. Spend 15 years either at a big four consultancy
4b. Spend 15 years at the company you intend to be CTO at and be good at corporate politics
5. Have a super technical wingman who is loyal (and doesn’t want the CTO job)