unaffixed
To learn a lesson (from a previous mistake); to stop doing s.t. or to be apprehensive about doing s.t. again (after a bad or painful experience).
Even though they have been spanked they still have not learned the lesson.
He has learned his lesson.
I am apprehensive to lend to him because he does not pay.
To punish (in order to give a lesson).
A person may be beaten, put in prison, told if you do that I will do such and such, etc.
Punish one of the children so that they will be afraid.
Now I will punish children (before I didn’t) so that they will not be bad.