The marks are a thing was very briefly explained at the start, but it was an easy to miss thing, so I'll offer a broad overview here:
The marks of purity are a series of interlocking facial markings that (usually) appear on a person's face when they lose their virginity, typically covering their left eye lid. There are times when they don't appear, even after someone has lost their virginity. And there are times when they appear even when someone is still a virgin. For example, they wouldn't tend to appear if you lost your virginity while you were unconscious, but they might appear if you get too excited during a first time, and reach orgasm before any of the actual sex has happened. In essence, it relates more to the personal sensation of sexual innocence than actual sexual history.
The marks of pain, on the other hand, tend to cover the left cheek, just below the marks of purity, and they tend to appear whenever a person has experienced a large amount of pain. Most people develop them at some point, and the age range varies. Some kids get them breaking their arms. Some people get them by giving birth. They aren't exactly stigmatized, cuz they can be caused by pretty much any injury.
As for why and how they happen... Spoilers.