With one exception, the best managers I had over a 30+ year career knew nothing about programming. What they knew about was shielding developers from unrealistic expectations, pushing back on the user community's unreasonable and inconsistent demands, ensuring that budgets were adequate for the projects, arranging support from other departments (such as shipping/receiving and purchasing), and listening to what their technical staff were telling them about proposals and in-the-pipe projects.
The one exception was good at those things, too; they just happened to also have over 20 years of programming experience from running their own consulting business.
The worst bosses I had were the ones who'd take the arbitrary "requirements" dictated by the user communities and tell the developers they "had" to meet those impossible schedules, who failed to make resources and budget available to do the work necessary, who overscheduled critical resources such as designers and senior developers, and who insisted on meetings between the users and even the most junior of technicians to "get on the same page."
The one common thread of every bad manager I ever had? They were MBA majors. Not as a secondary add-on degree, but as their primary degree.