Why do you get smegma?

Smegma is a natural lubricant produced by the human body in both males and females to facilitate intercourse