There are both micro and macro responses to this question. The first response is micro, the second hints at the micro, but asks you to connect it to the definition of sociology. In my sociology courses, I take the macro, systemic, structural approach to making this connection. Society is made up of a set of mutual understandings that essentially help us all get along and maximize our experiences with one another. These mutual understandings are shaped by common norms, values, and ideologies that allow us to work together. When these norms, values, and ideologies do not match, or our communicative wires get crossed, then we have conflict. In order to avoid conflict, we have prescribed sanctions that both prevent deviance from the norms, values, and ideologies. Some of these sanctions are informal (dirty looks, teasing, name calling, expulsion from school, etc...) and some are formal (arrest, jail, etc...). The more extreme the norm, value, and ideology, the greater the sanction. The study of these norms, value, and ideologies and their associated sanctions is exactly what we sociologists consider primary to the discipline. Criminal justice is the study of this exact aspect of the larger body of work that is done in sociology.