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.
(..) Well, how is the great actor? l don't wanna be an actor. Stromboli was terrible. - He was? - Yeah, he locked me in a bird cage-- - He did? - Uh-huh, but l learned my lesson. - l'm going-- - Oh, you poor, poor boy. You must be a nervous wreck. That's it, you are a nervous wreck! Bless my soul. (..)1940 Pinocchio