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.
(..) Dad, I'm... I'm sorry. Let's go home. I thought you were very brave. Zazu? Yes, sire? Take Nala home. I've got to teach my son a lesson. Come, Nala. Simba... Good luck. Simba! Simba, I'm very disappointed in you. I know. You could have been killed. You deliberately disobeyed me. (..)1994 The Lion King
(..) Zazu, would you turn around? Stay low to the ground. Cheetahs never prosper... Okay, stay low to the ground, right yeah... What's going on? A pouncing lesson. Oh very good. Pouncing. Pouncing!?! Oh no, sire, you can't be serious... Oh,... this is so humiliating. Try not to make a sound. (..)1994 The Lion King