In all mammals the genitals are covered and protected with foreskin. Both males and females are born with foreskin. The foreskin in female protects the clitoris, in the male the glans penis. In the male, the foreskin has multiple functions and contains nerve endings and blood vessels.
The foreskin serves a similar purpose to the eyelid. As the eyelid shelters the eye, the foreskin protects the glans penis and the urinary tract. Both the eyelid and foreskin secrete lubricants and antibodies while retaining moisture on the under side of the mucous membrane. Smegma is the white emollient under the foreskin. It usually has a connotation of being unclean. It is clean and plays an important role in moisturizing the glans penis. Specifically the foreskin helps to maintain penile warmth, proper ph balance and cleanliness. In a circumcised penis, the lack of the protective foreskin can lead to desensitization.
As part of the immune system, the foreskin produces antibacterial and antiviral proteins to protect against infection. Sexually, it is rich in nerve endings and is as sensitive as the fingertip. It is more concentrated in nerve receptors than any other part of the penis. The motion of the foreskin aids in stimulation. The foreskin secretes lubricants which can enhance sexual intercourse. Some researchers argue that an intact penis has more erogenous sensations.