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.
(..) Men are brave. I bet your parents taught you, that you mean something. That you're here for a reason. My parents taught me a different lesson. Dieing in the gutter. For no reason at all. They taught me the world only makes sense, if you force it to. You were never a god. (..)2016 Batman v Superman: Dawn of Justice