It just kind of happened. Because millions of years.
BTW, I've proposed a mind experiment, namely, let's take a few laptops along with a few DVDs with OS images and grind them to powder, mix with sea water in a flask, and then bombard the flask with lightening. The question is: how many billions of years before that system evolves back into the original laptop? Will tiny discrete components like resistors, and then transistors first form, and then evolve to primitive integrated circuits, followed by CPU chips and such? And how will the software come into being and evolve? First a simply assignment statement, then a DO loop, then a full blown algorithm that slowly evolves into Windows 7? Quite frankly all of the above has a much greater probability of occurring naturally and much quicker than the evolution of seawater and lightening into human beings because laptops and operating systems are billions of times less complex than human beings.