The Selfish Gene by Richard Dawkins
Another curious aspect of the theory of evolution is that everybody thinks he understands it.
-- Jacques Monod, pg. 19.

Evolution is what happens when you have something A that can replicate itself and something B is killing As. The As that survive and replicate will pass on their configuration information (genes). This configuration information may be causally related to the fact the A survived (had faster legs than the B chasing it), or it may be just a correlation (the comet B struck over there, and this A wasn't over there). The As that survived may be quantifiably better in some regard (land speed), or they may not be.

Ceteris paribus, replicators that copy themselves faster, more error-free, or last longer than other replicators will outcompete other replicators for resources. If they copy faster, they'll dominate the population. If they copy better, they'll transmit the causally-related survival information better. If they last longer, they'll sire more replications. This error-free replication runs counter to evolution; nothing "wants" to evolve, so much as it's chased, kicking and screaming, through the world around it.

Driven by the odds of survival, evolutionarily stable strategies (ESSs) will develop. I'm not smart enough to succinctly explain this now, so you'll just have to read the book. ;)

Dawkins introduces the ideas of Memes in the final chapter and claims that ideas (composed of memes) are also subject to evolution. Best to learn what has worked and not worked in the past, then.