I think you're confusing or conflating civil and criminal courts. If someone breaks a law, that's generally a matter for the state to decide in a criminal court. If someone was damaged (i.e. if the victim feels the perpetrator owes them compensation), that's a matter for them to bring up themselves in the civil courts. These are separate functions; one situation could be tried in both courts. A famous example off the top of my head is that even though OJ Simpson wasn't criminally convicted of murder of Nicole Brown and Ronald Goldman, a civil court found him liable, awarding tens of millions of dollars in damages, to be paid to their families.