They were basically the medieval version of cops. We're still trying to figure out how to give people the power to protect others without giving them the power to abuse others to this very day.
The trouble is that there seems to be a very blurry line between the two on both an institutional and internal psychological level. To quote Twitter user @meganamram (from before it for completely fucked as a website): "You can’t be nice to everyone because being nice to certain people is inherently cruel to others." For every case that appears to be an obvious case of good versus evil there's fifty more that are weird muddy bullshit where there's no winner and the closest you'll ever get to justice is deciding who should lose harder.
And unfortunately the loser usually just defaults to whoever doesn't go to church with the cop, which was probably also true in medieval times.