Bach, as well, used to write pieces to teach his kids music.
I wonder if going back to the roots and simplifying the craft had something to do with their creative process.
Bartok also did this in his Mikrokosmos - I used them to relearn piano and it was very entertaining to (re-)'learn' piano solely though modernish/Hungarianish music. I wouldn't personally have wanted it for my first attempt at learning piano, but as someone experienced already, it was pretty great!
The well tempered clavier, which is an extremely popular piano suite, was written as practice material for his students (there’s a piece in every key).
In some sports it is also a saying that you improve your game drastically the moment you start teaching.
I think in some way in tech this is also true. Be a mentor !