How does lubricating your chain help protect your cassette and chainrings from wearing too?
In the ideal case, the chain will not actually be rubbing significantly against the chainrings under load. As the chain wears, the spacing between the chain links becomes different from the tooth spacing, and this difference in spacing means that there is sliding contact as the teeth engage the chain.
The rollers inside the chain help to convert some of this sliding motion into rolling friction (transferring the actual sliding contact to the more protected and better lubricated internal joints of the chain), but any binding of these rollers against the pins again leads to sliding contact between the tooth and the chain.
Keeping the chain lubricated (and, as noted in the question comments, clean) will both minimize the wear that stretches the chain and prevent roller binding, thus reducing the wear on the teeth.