The foreskin acts as a cover for the glans and produces smegma for a protective coating. This is particularly important if wet diapers are left on too long, since decomposition of the urine can cause irritation of the glans if it is not coated with smegma. When mammals reproduce, smegma is deposited. If smegma contained a carcinogen or even an irritant, then the propagation of the species would be jeopardized. No such phenomenon exists.
Smegma is probably the most maligned body substance.
Not only is smegma not harmful, it is actually beneficial, serving as a protective coating and lubricant for the glans. In 1942, the National Cancer Institute conducted careful experiments and found that smegma had no carcinogenic effect whatsoever. This test was duplicated in 1963 on a more extensive scale by Dr. D. G. Reddy and others, with the same conclusions. It provides the necessary mucosal lubricant and moisturizer and is rich in sexual pheromones. The prepuce normally prevents detection of this phenomenally charged scent until the glans is exposed at the time erection takes place.