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.
(..) protection! That's our deal. Yeah, well, the deal just expired. Now, get lost. Mark my words, Mittens. One day, someone's gonna stand up to you! Someone's gonna teach you a lesson! Yeah, I'm really scared now. You should be! Aaah! Okay! You... Where is she? - Who? (..)2008 Bolt