To teach is to transfer ideas or skills to another person. As an old saying goes, "Give someone a fish, they eat for a day, teach someone to fish and they eat for a lifetime." I hope they like seafood.
The Old English word tǣcan, which became the Middle English techen, meant "to show or point out." But the Old English also had another word for teach — læran — which eventually became the modern "learn," with the current meaning of receiving knowledge rather than giving it. If someone tries to "teach you a lesson," he or she tries to punish you for something you've done in order that you won't do it again.