I'm definitely a subject matter expert. And I'm able to get pretty deep content into middle school and high school classrooms. And working with smaller subgroups of students is a lot like mentoring junior engineers.
But man, dealing with a lot of kids in the room is a challenge-- keeping the lower third of students motivated; modulating strictness up and down so that you can have exuberance but not disruption; picking up on the subtle signs that there is a problem from outside spilling over into the classroom while multitasking and doing 3 other things. And... just coping when there's an entire class period that felt like a waste and you don't know why.
It is -hard-, and I'm dealing with an unusually easy teaching environment (classes of ~18-20 of well-behaved and academically advanced private school kids). I'm also not a core teacher and so I have the benefit of leaning on other professionals to do the heavy lifting in these areas. I still have hope I'll get good at it (this past year was a difficult one for me to self-assess my performance).
I do think that being an expert/having passion for what you teach is a bonus: if you have students that are already inclined to be engaged, that spark will help a little in getting and keeping their attention. But it is not the most important thing day to day.
Actually, my best performance lately was when I was a long-term sub in science classes teaching subject matter that is not my core competence. I could geek out and learn deeper stuff than I knew about volcanoes and share my surprise with the students, and that felt really good for engagement.
If you are a private school, sure. This is not the case for unionized public schools. Did you hear of that famous case where a superintendent fired multiple teachers for abysmal performance and even abusive behavior and was forced by the courts/union to reinstate them with back pay? It's very eye opening.
I'm sure there are states where teachers are underpaid. My state is in the top ten and that is not an issue here. I know a teacher making more than I do as a developer. The local district spends $14k per student per year (about average for the state). Money is not a problem here. There are still districts that have poor performance and test scores.
Instead if just trying to throw money at problems, we need to change the structure. Pay for performance would be a great way encourage good teachers and discourage people who perform poorly. It can be tricky to get the right metrics. The biggest issue is that the teachers unions oppose this.
You're mostly correct though, that they are separate things. For teaching technical topics well, both are needed.
Is there data on the average effectiveness there?
Now we could use a performance based pay system that could pay teachers more. Some of those systems fail to capture the right metrics. All of them are opposed by the teachers union. I think a slightly below average salary (factoring in benefits which are not typically seen in industry) with the potential to make more than average based on performance would be a good system.
Higher pay under a pay for performance structure and the ability to remove ineffective teachers would be good. This would bring it more in line with industry. It can be tricky to get the right metrics. The bigger issue is that the teachers union opposes any of them.