It is said that we learn more from failure than success. However the way our brains work is that we learn more easily from success so that the lessons from failure are learn more deeply.
One of the classic examples is what happens if we press a button. If the button does nothing then we ignore it. If the button gives us a reward, then we will press it to get the reward. But what happens if the button sometimes does nothing and sometimes gives us a reward.
This result in what is called partial reinforcement, which is stronger than if we were rewarded all the time. We learn from the success and learn nothing from the failure, in fact the failure pushes us to keep trying.
So what is happening in the brain. Our brain is geared to success not failure. When we get a reward our neurons light up and record that the action is associated with a reward. When there is a failure our brain does very little.
So getting back to learning from failure, our natural ability to learn from failure is limited. Instead we need to consciously make the effort to understand our failures and change our behaviour.
It is not that we learn more from failure but that we learn in a different way. It is also why many people seem to be unable to learn from failure.