Smegma is a natural lubricant that is produced by the glands in the tip of the penis and foreskin. It keeps the penis moist. It's found on the head of the penis and under the foreskin. If the penis is not washed every day, a cheesy-looking substance(smegma) can build up. If it builds up in the foreskin, it may smell, prevent easy foreskin movement and become a breeding ground for bacteria which can cause redness and swelling of the head of the penis. Keep the tip of the penis clean by washing gently with water.
Attribution: Straight Talk Foundation