How are fingerprints formed?
Fingerprints are called epidermal ridges in Biology. These are formed between the 3rd and 4th month of the fetus. The epidermal layer looses its strength, becomes like a cloth from a piece-board and falls on the underlying layer of skin cells, the dermal papillae. Now, you must realize that not all tissues are as smooth as the skin for evolutionary reasons. This tissue, although a part of the skin, is irregular and some its cells get little more swelled up. After falling, the epidermis begins to harden up and thus takes its shape.
This phenomenon has probably evolved from providing friction for traction and increase in surface area for sweat to come out.
Read more at:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1013024/