The human skin is a series of living cells that can react to certain
stimuli.
Sunlight damages cells in certain way, and cells react by
producing more intense concentrations of melanin to defend themselves.
In naturally sunnier, hotter places, people with darker skin naturally
develop. This is why light-skinned humans developed in northern Europe
and Russia, where sunlight is dimmer, winters are longer etc.
Skin pigments because it is filled with melanocytes, smaller cells that
produce eu and pheomelanin.
Hair has these same cells, but only in the core and at the very base of
the stem. A hair follicle is a complex strand of proteins, but cells
from the skin up are all dead. They bleach in sunlight, because no new
melanin is produced on the inside of the follicle itself.
It is because of living cells, too, that melanin in human eyes are also
not sun bleached.