The magic is that you have rules, you have bans, and you only actually do them when most of the site agrees, and if rules are broken or most agree that there can be a little bit kangaroo.
Like, I might been a silly willy and forgot to write a rule that no minor exploiting material or you will be banned, IP blocked and reported to authorities rule so even if I did not write one down, I do not think people get that mad if I still do that.
Good moderation could by vibes be softer or harder on rule breaking and also punishment. My favorite one was "No Trolling" rule that was nebulous just so when situation called it, Ban, 30 days "No Trolling", the secret ingredient is crime to be just extremely selective and understandable to regular users if you pull stuff like that off. But, then again, I seen some stuff too. If you want a low-entry no-skill Lawyer's 24/7 on call retainer job disguised as a hobby, you start and run an internet discussion forum of some kind.