A criminal offense, which is classifed as such in many jurisdictions. The common understanding is that these are acts whose motives are primarily sexual gratification, with an implicaiton of non-consent on the part of one party. In legal fact, entirely consensual and conventional sex acts between partners are classed as sex crimes in some places. So, for instance, age difference between the partners may automatically put an act in this class. In the US, several states classify sonventional intercourse between a girl and boy as non-criminal if both are, say, under 18 and older than 14, but as a sex crime if one partner is older than 18.
Acts that may be classed as sex crimes include rape and molestation, but may also include acts of voyeurism or display involving invasion of privacy or exposure to public view. IN most places in the developed world, mere possession of images of underage persons in salacious poses or positions is a sex crime, regardless of whether sex acts or nudity is actually involved.
In a BDSM context, depending on jurisdiction, such acts as bondage, non-conventional sex (eg, anal sex, oral sex, unusual positions, ...), though desired by both parties, may be treated as a sex crime by police, prosecutors, or courts. Actually flogging, tawsing, paddling, etc may be treated as a sex crime or as assault and battery, depending on the jurisdiction, and regardless of consent of both parties.