You understand natural selection, right? There can be 1000 harmful mutations in a population, but if just one of them is beneficial, that one might help the organism survive and therefore the mutation might stick around longer than the others that got no mutation or got a harmful mutation. The beneficial mutation is selected, naturally, based on the environmental conditions. So that pretty much answers how an "accidental copying" as you put it can create all the complexity we know today. It's a step by step process that builds off of what came before, and over extreme lengths of time, can produce quite complex things like you and me.