In general, schools have no way of measuring performance or effort in teaching. They can try to do it by using student evaluations, but student evaluations don't actually measure effort or performance. People get good evaluations by giving high grades and giving polished presentations. If you've taught freshman calculus a dozen times, and all you do is walk into the classroom and deliver the same canned lecture year after year, your teaching evaluations will be fine, even though you're putting in zero effort. Another way to get good teaching evaluations is to give scantron tests and tell your students what will be on them. There is some good material on this topic in the book Academically Adrift, by Arum and Roksa. They cite an implicit contract between teachers and students: "I'll leave you alone if you'll leave me alone."
I think this varies quite a bit from school to school. First off, not all schools really care about research. For example, California has a three-tiered system, consisting of UC, Cal State, and community colleges. At community colleges, research is neither expected nor supported. At Cal States, some research is required in order to obtain tenure, but over all there is very little emphasis on research. So at many schools, the consequences of ceasing to do research are zero.
Other answers have suggested that if you slack off, you will not receive promotions and pay raises, and will be stuck with scutwork. Again, this depends on the school. At my school, promotions and pay raises are on a set schedule, which is negotiated by the union and depends only on seniority and education. In my experience, people who avoid working hard on their primary responsibilities of teaching and/or research are the same people who avoid committee work.
In summary, my experience is that external incentives tend, if anything, to be anticorrelated with the quality of one's work as a tenured professor. People who do a good job and work hard are doing it because of their own internal motivations.