Some evolutionary biologists have argued that traits should be optimally adapted because optimal adaptation is what we expect, given enough time for mutations to occur, from natural selection. Since there has been a lot of time for evolution through natural selection to occur, they would argue that most traits should be optimally adapted. Other evolutionary biologists have argued that many traits may not be optimal adaptations. There are a variety of reasons why natural selection might NOT have had time to lead to optimal adaptation. If a mutation changed one structure it might as a result hurt the development of other structures, if those other structures depended on it for normal development.
Traits thus reflect phylogeny.
Because of this, any of the above reasons for species not being optimally adapted can result in what is called a phylogenetic contingency. A phylogenetic contingency occurs when a species does not become optimally adapted and, instead, retains the characteristics of its phylogenetic ancestors. Because species that are not optimally adapted will tend to retain the traits of their ancestors, we can use phylogenies to test for adaptation. We do this using something called the phylogenetic comparative method in which we compare species that occur in various environments or have various characterstics to see whether the traits of organisms are related to their environmental conditions. If traits are adaptations, we would predict that they would evolve in association with the environment to which they are adapted.