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.
(..) of the Black Pearl. What? He failed to mention that. He plays things closer to the vest now. And a hard-learned lesson it was. Three days out, the first mate comes to him and says everything's an equal share. (..)2003 Pirates of the Caribbean: The Curse of the Black Pearl