On the end a "competitive advantage" is a thing that helps to nicely explain a lot of things like vision, self-consciousness, feelings… Does nothing to the reason why Von Neumann machines appeared on our planet thought.
"The Selfish Gene" attempts to explain this, starting with self-replicating (IIRC) predecessors of amino acids in the primordial soup, which became more and more complex. It's been a while since I read it, so I don't recall details any more.