An explanation of why it came about would be cool too
hi! you'll find links to a few posts on policing in a few ancient societies in here
Also, while I was hunting that down, I ran into a few more recent posts on policing, so for anyone with an interest in other time periods, here they are
What was the analog of police in medieval England? - Medieval England
What is the origin of police in the United States? - 19th c USA
NB: if you have followup questions on locked posts, ask them here & include the relevant user's username so they'll be autonotified