When I took Ae105 at Caltech, the NASA MSL project manager explained it like this (I remember the numbers he used clearly): a mission might cost $500 million with an 80% chance of success, or they can spend twice as much to increase the chance of success to 95% by investing a lot more in upfront testing and R&D. Now, the smart thing to do - given a billion dollar budget - is to take that first option because if it fails you can try again and the probability of both attempts failing is only 4%, compared to 5% for the expensive single mission. Then you’ve got an 80% chance of having $500 million left over for a different mission.
The public and decision makers react irrationally to any failure, putting funding for other missions and the entire program in jeopardy. NASA and ESA have to make some extremely suboptimal decisions to make sure that funding doesn’t get catastrophically cut.
The above is the example the instructor used to easily illustrate his point but he said the real numbers are even more stark. Often times the cost savings of just building a second copy of the payload along with the first means it costs $600 million for the first attempt, and only $200 million for the second (the cost of the launch vehicle and keeping people on staff), saving hundreds of millions overall.