Won't natural selection miss the overall minimum of a function?
What I think the question is "Why wouldn't an organism be more efficient from selection than the environment demands?"  Please let me know if I'm hitting the mark here. 

A scenario suggested by the question is this: If there is selection pressure on say an animal to resist a disease, and then it evolves two resistance systems to the disease.  This could be an immune response and a taste for a certain plant containing compounds with remedial properties.  If either system is adequate to resist the disease, hasn't selection gone above and beyond what is needed? 

If so, the answer is either not recently, or all the time.

First, for 'not really' you have to consider the importance of competition.  Reading about the Red Queen's Hypothesis is helpful here.. First there is a natural random mutation rate, which can cause one of the system to become less effective.  Or if the disease is also changing to increase its efficiency, then either one or both of the defense mechanisms in this case would fail from time to time.  Then having two systems would not be too much. There is a clear benefit to having redundant systems of resistance here. For both these broad categories of reasons, you have much redundancy and interdependence among the genes which create traits in living things (phenotypes).  Because of the background mutation rate, traits which are not needed disappear relatively quickly; because of competition, those which convey an advantage, even if a small one, have a strong likelihood to stay in the gene pool.

now: "all the time" There are cases where traits are exhibited that are not efficient though. Evolution works over generations, typically selection influences traits on the order of 10s of generations and the population can show traits which are not helpful if the environment or the competition has changed drastically.  

An example of this is the current obesity epidemic in the developing world. The sudden availability of cheap food has caused those people who have access to become obese.  This is because they have a heavily reinforced trait to save up fat because humans experience famines regularly.  Its going to take a long time before efficient energy storage in human beings is lost.  In the meantime, people are not living to reproducing age at the same level of fitness they might have.  

I want to add a note on genetic algorithms.  The difference between genetic algorithms to achieve the same efficiencies as biological systems are worth thinking about:


As far as failing to find a global minimum, natural selection usually has many more samples.  A typical selection experiment with flies or worms often have thousands or tens of thousands of individuals screened.  GA models of reasonable complexity have usually a few score at most - am I right?  A bacterial or yeast experiment can have 10^9 individuals. 


The genetic system of the chromosome itself is tremendously complex.  We can't even model itself and so the product of millions of generations of selection already will has a heretofore unmodelable response to selection. 
The typical selection environment is equally undefinable, so a survey of living things in a complex environment has unpredictable effects.  While most of us think as laboratory experiments as being less complex, its not completely true.  I was at a talk recently that mentioned how E coli K12 seems to have diverged in various laboratory environments despite the fact that its mostly been in frozen stocks since being isolated in the mid 20th century.