builds character

The consequence of events that one has confronted and won over which enable one to gain a better self-understanding.
In most cases this is said to young people just as they are about to embark on a humiliating experience that adults think will somehow be beneficial.