Q: What works by selecting for alleles that confer beneficial traits or behaviors, while selecting against those for deleterious qualities? A:
The answer is:
natural selection