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.
(..) never get the message! My father gave me that truck, you motherfucker! You ever shoot at firemen? You come here, you shoot at my family? I'm gonna teach you a real lesson, motherfucker. Put your fucking mouth on the curb. Come on, man! Put it on the curb! Right now! - That's it. (..)1998 American History X