Not only do teaching skills play no role in getting tenure at a place like Stanford, teaching is actually a threat to research productivity and research universities will hire professors who do as little teaching as possible, leaving most of it to older who professors who are no longer productive researchers or to post docs, teaching assistants or other staff.
To understand how this works, the researcher will apply for some grant, say $300,000 to study some question in geometry. Now, why does a mathematician need grant money when their only tools are a paper and pencil (maybe a laptop with Tex installed)? First, the university gets 1/3 of that money as "overhead", so the researcher is left with $200,000. Then, the researcher will pay to "buy out" his teaching load which is more money paid to the university, say $150,000 to not teach 2 classes for a year. With the remaining $50,000, he may spend money to fund a post doc to come and assist him for a semester. Again, that money goes to the university. So the researcher may get $300,000 but it all ends up in the pocket of the University, which in turn pays him a good salary with the assumption that he keeps the grants coming. A place like Stanford gets about 1/3 of its funding from these research grants, 1/3 from its endowment, and 1/3 from tuition. It hires researches to get the grants, grad students and adjuncts to teach, and the sports teams and other events help with endowment.
Thus research professors are hired on the basis of their ability to avoid teaching loads, not on their teaching skills.