Why do some minifigs have yellow heads and some are flesh colored?
To answer the first part of the question, the Company Profile presentation (deep, direct link) states:


  When the minifigure first appeared, it was decided that its face should have only one colour: yellow. And that its facial features should be happy and neutral . The figure would have no sex, race or role – these would be determined by the child’s imagination and play.


It then explains when and why they added colour for their licensed figures


  With licensed products such as LEGO® Star Wars™ and LEGO® Harry Potter™ the figure began appearing in specific roles, and with LEGO Basketball in 2003 it took on authentic skin colours. In 2004 the LEGO minifigure assumed an even wider range of skin colours when it was decided that the figures in licensed products should resemble the original characters as closely as possible. One result was that the figures in LEGO Harry Potter™ changed from yellow to a more authentic skin colour.


The first ones I remember seeing were indeed some of the NBA League characters as part of the Basketball theme in 2003, followed by the Star Wars products and then the Harry Potter sets in 2004.

Lando Calrissian was one of the first to appear in the correct skin tone, amongst yellow Han and Leia:



Followed later by pink characters for the rest. The first Star Wars set in 2004 with flesh-toned figures was the Millennium Falcon. By 2005 the transition for Star Wars was complete and all sets used flesh-toned figures.

In terms of other colours, LEGO had already created various monster and alien figures with different coloured heads ranging from blues and greys through to transparent and even transparent neon orange.