They need to know enough that they can work effectively with engineers, participating in things like bug prioritization and scoping meetings, but they don’t need a computer science or electrical engineering degree. Especially for software PMs, knowing how to code even a little will be beneficial, and if you want to become a PM but don’t know how to code, we’d highly recommend learning the basics.