The adaptation is happening at a higher level. Down in the DNA, there is only variation. Consider the constant recombination of DNA that occurs through meiosis (gamete production). Here is a pretty good explanation of recombination. The reason why recombination changes anything at all is because the DNA being passed down had come through random sources of mutation from generations past. Here is a pretty good explanation of mutation as it pertains to haplotypes. It's one thing to say mutations appear randomly across a generation. But what accounts for the fact that some are passed down and others are not? Obviously sexual selection determines which individuals will propagate their DNA. But then those individuals must actually reach maturity in order to engage in sexual selection. That leaves the question of what determines whether an individual reaches maturity, and the answer is natural selection. Since natural selection works at the level of the whole organism, and since it is statistical - such as we see in mutations - there are always cases of individuals that survive long enough to pass down traits that are not beneficial to the population. These may linger as recessive genes, only to be exposed by changing conditions in the future which threaten extinction. This is the level at which we notice that an adaptation has occurred, because the needed trait becomes dominant. There is one more case to consider, one in which natural selection does not have to play a significant role. And this is genetic drift. Here the causes for one trait shifting from recessive to dominant will simply be a matter of chance. Another way to say this is that when the statistics of recombination and mutation offer a smaller number of permutations on allele frequency, then the population will tend to become more homogeneous. This happens when a population becomes isolated. Invariably geographic isolation leads to genetic drift. But then we see adaptive radiation in which the geographic isolation imposes new pressures and/or a new niche. Consider in humans the high rate of natural abortion and still births, the considerable rate of birth defects that prevent an individual from surviving and succeeding in sexual selection, and you will notice that many sections of the DNA are self-stabilizing. Also consider this: humans are 99.9% genetically identical. Of that 0.1%, 94% is identical within populations, or 0.094%. That leaves 0.006% to account for the most widely varying alleles.