I'm glad they got caught. That will 'teach them a lesson'! [=they will learn that they should not do that again]
We 'learned our lesson' the hard way. [=we learned from an unpleasant experience]
They studied the 'lessons' [='teachings'] of the great philosophers.
(..) and let me tell you why. Johnny Fontane ruined one of Woltz International's most valuable prot'g's. We trained her for five years. Singing, acting, dancing lessons. I spent hundreds of thousands of dollars on her, to make her a big star. Let me be even more frank. (..)1972 The Godfather