Generally success is the outcome and product of some of the favourable factors. When we are successful, we will not understand how we became. We also do not bother to know.
Failure is outcome and product of abnormality within one or more than one favourable factors. When we fail, we try for success by altering each and every factor.  Thats how we learn about factors. When we try next time after learning, we will control all the factors and success is acheived by default.
Let us take an example. When we sow a seed, it sprouts only when there are favourable conditions like, good soil, humidity, sunlight and air. When there is some problem with any of the conditions, seed remains like a seed. Then we try to change conditions. Thats how we learn about factors. We control conditions. We provide perfect environment to seed. Then it becomes mandatory for a seed to sprout.