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.
(..) - Whatever it takes. What were you going to do, hit the man? - He went into my desk! - He was years old! It's never too late to learn a lesson. - This is it, Emily. I mean it. - I know you do, Richard. The next time you plan a function, we will rent a hall and do it properly... (..)2004 TvShow: Gilmore Girls Title: The Nanny and the Professor Season: 4 Episode 10