You searched for: “qui docet discit
Qui docet discit.
He who teaches learns.

Whenever a teacher prepares lessons for pupils/students, he/she can not help but learn; that is, if she/he actually prepares the materials.

To put it another way, "The best way to learn a subject is to teach it." Every dedicated teacher knows the truth of this proverb.