How is it that self-reflecting, intelligent beings come out of non-intelligent matter?

How can a self come out of things (carbon, molecules, atoms, proteins and so on) “as selfless as a stone or a puddle?” How does all that “meaningless” stuff that makes us up in the physical universe, grow into an entity that can refer “meaningfully” to itself, perceive itself, talk about itself, become self-aware?

Gödel Escher Bach (by Douglas Hofstadter) should be mandatory reading for anyone who has ever asked these kind of questions.