Okay kiddo, have you ever heard of a judge? A justice of the peace is like a judge but they deal with smaller problems. They help people with things like getting married, deciding who gets to take care of children, and deciding who keeps a pet when a couple breaks up.
They're called "justices of the peace" because they're supposed to help keep things peaceful. They make sure that everyone follows the rules and that everyone is treated fairly. They don't wear fancy robes like judges do, but they still have to be really smart and know a lot about the law.
So if someone needs help solving a small problem that involves the law, they can go to the justice of the peace for help. The justice of the peace listens to both sides and makes a decision that they think is fair. And that's justice!