There is a common misconception that evolution continually seeks highly refined and optimized biological structures and organisms. Evolution, through natural selection, is limited to the materials provided by self-organization, which is imperfect, rather ad hoc, and the result of highly variable processes. When organisms compete for limited resources, the organisms that are best suited to the local environment tend to be more successful in a survival and reproductive sense. Characteristics of organisms are endowed through mutations caused by various anomalies and permutations that are the result of sexual reproduction. These mutations and permutations are not directed in the sense that one would often think. The laws of physics and biological processes place limits on phenotype and genotype changes but there is no master plan or foresight.
Unable to find adequate resources, the organisms that are less suited to the environment are often pushed out of the local environment, marginalized, or driven to extinction. This is the result of limited supply of materials necessary to sustain life.
It is very possible that there are numerous other possible biological designs that would be much more efficient and better suited to any given environmental niche. However, the mutations and permutations provide a limited number of often much less efficacious forms. In the rather random walk of slowly accumulating small changes, evolution is provided with a relatively limited number of designs to test.
With some careful analyses of the environment, consideration of biological possibilities, and thoughtful design organisms could probably be developed that would out-compete the most successful organisms found on earth during any period. This is not to say that life forms are not elegant, adaptive, and robust. Because of the continual pressures from the environment only durable and successfully reproducible structures have survived. However, all organisms have only had to compete against other organisms designed by the same imperfect, ad hoc, organic mechanisms. Pitted against a carefully designed foe, most organisms would succumb.
The idea that evolution is backward looking, meaning it only acts on the last generation’s designs, is evident in mass extinction events. Things that are adaptive in current environments are often maladaptive to new environments caused by things such as severe atmospheric or marine environment changes. Some nutrient demanding body forms that survived and thrived in the relative lushness of the Triassic, Jurassic, and Cretaceous perished quickly in the dearth that followed the K-T boundary impact event. Small organisms, particularly mammals that had inhabited a very narrow niche before the K-T impact were able to survive because of fewer nutritive demands. Mammals were then able to gradually expand into some of the niches left open by the newly extinct species.
Through large extinction events and the ever present background extinctions, natural selection has sifted through the available options for roughly 1.5 billion years for eukaryotic organisms. The sifting was present for almost 3 billion years prior to that albeit with much more rudimentary cells and various building blocks. The farther back one goes the sketchier the actual structures become. We will probably never know exactly how life evolved from amino acids, lipids, etc. to first prokaryotes and then eukaryotes. However, science is uncovering general patterns such as the self-organization of lipid vesicles. Such discoveries continue to point to the laws of physics as the guidance provided for evolutionary processes.