How do cells figure out the big-picture shape?
Hands are complicated and the genetic machinery behind their shape doubly so. 

It's easier to figure out worm segments first, and then work up from there. An egg has head/tail information encoded in it even before fertilization: see here

You can imagine the first or second cell division would give a 'head' cell with higher concentration of head polarity transcription factors. These transcription factors switch on other regulatory genes, and the complexity works upwards from there. For more information about how worms and other segmented animals work out what goes where see Hox genes. The sad truth is that most of how this is done is unknown or not well understood.