what a complex question it is that you ask?
i don't mean to be facetious but the answer is complex way beyond my ability to answer.
lets forget for now the medicines that have been discovered as a result of luck and intuition.
in this day and age 'designer' medications have been and are being created. the scientists who create these medications know exactly the nature of these substances. they know the exact spatual configuration of the molecules in 3d. and many of them are extremely complex. they know each and every atom that makes up the molecule and they know the bonding characteristics of these molecules. they know how these molecules "dock" with specific molecular sites in our cells or the cells of invading bacteria or virus's.
they know the energy cylces and biochemical process that take place in cells. metabolic pathways... it goes on and on.
what i have mentioned above is but a miniscule synopsis of what biochemistry is involved in, in the field of medicine. my first year biochemistry textbook from nearly 30 years ago has almost 900 pages of data and theory that describes the chemistry of biological systems. within those pages is referance after referance to book after book and paper after paper with respect to this field.
also contained with in this text book are referances to the theory of evolution. the first referances have to do with a study of why it is that only 22 of the 100 chemical elements found in the earths crust are essential components of living organisms. the answer boils down to the biological fitness of organic compounds.
the next referance found in the text refers to the biological fitness of biomolecules such as the 20 specic alpha amino acids that are the building blocks of protiens. also the question of why should only the purines adenine and quanine and the pyrimidines cystosine and thymine be selected out of the dozens of purine and pryimidine derivitives known for the essential building blocks of DNA in all species.
the answer the biomolecules we know today were selected from a much larger number of available compounds because of their special fitness which gave cells containing them superior survival value.
i won't go on but there are many other referances to the theory of evolution through out the text book.
my point is that evolution is an integral part of biochemistry, the logical application of which is useful in the creation of medications.