When a story has something to teach its reader, it has a lesson. The lessons of many folktales range from "always tell the truth" to "be brave" to "find a prince."
There are different kinds of lessons, but they're all meant to teach someone how to do something or some new information. In a French lesson, a teacher teaches you the French language, and in a sewing lesson, you'll learn how to make something using fabric and a sewing machine. A typical day at school is one lesson after another. Originally, lesson had two meanings: "something learned by a student" and "a reading aloud from the Bible."