Good teaching and good research are not incompatible, but they also involve non-overlapping skill sets. So being good at one does not entail being good at the other (alas).
But as with any skill, you have to train and train a lot to be good. Those who are trained in one are not always trained well in the other, hence the disconnect.
I think it easier for some disciplines, e.g. the humanities (philosophy for example) and less the sciences or engineering in part because the skill sets overlap less and less as you get more technical (again, generalizations but I think not inaccurate).
What really bothers me is using student evaluations as assessments of teaching. There is a difference between being entertained and being taught. And you don't get taught well if you don't (as a student) also step up to the plate...