Fingerprints are formed in the womb when the basal layer of skin grows faster than the layers above and below it, stressing it and causing it to wrinkle. The variations of whorls, arches and loops this creates are unique to each individual, and are retained throughout life. Scientists think that genes play a role, but the exact patterns of fingerprints are not shared even by identical twins.
The origin of fingerprints is in a layer of skin sandwiched between the epidermis and the dermis, known as the basal layer. Because the cells that compose the basal layer are beneath the epidermis, superficial injuries do not tend to change fingerprints.
The skin on the palms of the hands and the soles of the feet is known as thick skin, and it has a number of differences from skin on the rest of the body. The epidermis is thickest in these places, although the skin overall is thicker elsewhere. Thick skin has no hair follicles, but has more sweat glands than elsewhere. People have noticed the whorl patterns of fingerprints, and their uniqueness to individuals, for a long time. It is only in relatively recent years, however, that people have studied fingerprints and their uses in identification.