One of the best pieces of career advice I received as an undergrad was that if i wanted to go to grad school I should work as a TA for the freshman and sophomore level physics classes. As a TA for those classes I learned how to do all of the basics of mechanics, thermodynamics, electromagnetism, and even a bit of quantum mechanics in my sleep. I can still solve elastic collision problems on autopilot. And it turns out that one of the big tricks to doing well on the physics GRE (aside from just being really smart) is to be able to do freshman and sophomore level physics very rapidly. I credit most of my "decent but not terribly impressive" physics GRE score to those shifts in the tutoring labs on the 3rd floor of the Eyring Science Center.
But you don't have to take my tales of benefits of teaching as the only evidence for the link between teaching and success. A paper in Nature (see the review by the Chronicle of Higher Ed) purports to have objectively created a measurement of the quality of a grad student in the physical sciences as a researcher and then tracked that quality for groups of grad students that worked as TA's versus others that simply worked as researchers. To measure research quality they had 95 grad students write research proposals twice - once early in their grad careers and again several years later. The proposals where then graded by a review panel similar to those used by the NIH and NSF. Interestingly, they found that the two abilities most improved by teaching were generating testable hypothesis and valid research designs.
The authors limit their speculation as to why those two qualities are improved by teaching experience, but my guess is that teaching emphasizes understanding how fundamental concepts (e.g., conservation laws in physics) are used over and over again in progressively more advanced ways.