Nature did it the hard way, one step at a time. If a design was a little bit better at keeping a critter out of the reach of predators, then that critter had more surviving offspring. If it was a worse design, that version died out and was eaten...er...recycled for parts. Repeat eleventy-six million times.
Yes, I know, to most normal humans this is like giving directions to a location by saying "Move the right foot toward your destination, now put it down and pick up the left foot...". But I am addressing a moron here so we have to start at ABC.