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.
(..) All I wanted was to help you. I only wanted to help! And what did you say to me? Fly home, Buddy. I work alone. It tore me apart. But I learned an important lesson. You can't count on anyone. Especially your heroes. I was wrong to treat you that way. I'm sorry. See? Now you respect me, (..)2004 The Incredibles