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 a damn sight better then he deserves. Put down the rifle. Don't worry, I'm not mad at you. Just take out Smitty Bacall's handbill. Read it aloud. Consider that today's lesson. – Wanted, dead or alive. Smitty Bacall and the Smitty Bacall… gang. For murder and stagecoach ro… robbery. (..)2012 Django Unchained
(..) or mine for nothin'! BENNETT: Now look… Let's not forget why we're here. We gotta killer nigger over that hill there. And we gotta make a lesson outta 'em. – Okay, I'm confused. Are the bags on or off? – I think… we all think… the bags was a nice idea. – Yeah. (..)2012 Django Unchained