An example: The poison used to kill cockroaches worked effectively for a while. It was laced with sugar to make it more appealing to the cockroaches. The cockroaches who did not like sugar didn't eat it; the ones that liked sugar, the majority, did and died.
After a few generations, in cockroach land that's a short time period, the majority of cockroaches had the gene for an aversion to sugar and the poison didn't work because they wouldn't eat it.
It would be nice to think that the cockroaches talked with each other, sent out bulletins, talked with each other on their tiny cell phones, etc. to avoid the damned sugar, but the reality of it is the 'fittest' cockroaches, in this instance those with the fairly rare aversion to sugar, survived, and the others died.
I sometimes use the same expressions about adapting, but I don't mean it in the same context.